Welcome!

Welcome to the Official BlackBerry Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Developer
hemant_sain
Posts: 106
Registered: ‎12-09-2011
My Carrier: Aircel

Open video url in default media player.

Hi all

 

I want to open the video url in the default media player of BB10.

 

Please provide any suggestion for this.

 

Thanks in advance

Please use plain text.
Regular Contributor
marcossit
Posts: 84
Registered: ‎07-19-2012
My Carrier: Movistar-Venezuela

Re: Open video url in default media player.

                     MediaPlayer {
                    id: myPlayer
                    sourceUrl: "https://dl.dropbox.com/u/17458564/Nueva%20carpeta/Video/lovingyou.mp4"
                    videoOutput: VideoOutput.PrimaryDisplay
                    windowId: myForeignWindow.windowId
                    property bool isPlaying: false
                    onBufferStatusChanged: {
                        if (myPlayer.bufferStatus == BufferStatus.Buffering) {
                            // Show the ProgressBar when loading started.
                            bufferIndicator.visible = true
                            bufferingLabel.visible = true
                        } else if (myPlayer.bufferStatus == BufferStatus.Playing) {
                            // Hide the ProgressBar when loading is complete.
                            bufferIndicator.visible = false
                            bufferingLabel.visible = false
                        } else if (myPlayer.bufferStatus == BufferStatus.Idle) {
                            bufferIndicator.visible = false
                            bufferingLabel.visible = false
                        }
                    }
                }

 This my app for example

Download my App for BB10 http://appworld.blackberry.com/webstore/content/134103/
Please use plain text.
Trusted Contributor
kunal_one
Posts: 121
Registered: ‎12-23-2012
My Carrier: wifi

Re: Open video url in default media player.

try QDesktopService API.

 

 QDesktopServices::openUrl(QUrl(url));
Please use plain text.
Developer
hemant_sain
Posts: 106
Registered: ‎12-09-2011
My Carrier: Aircel

Re: Open video url in default media player.

Thanks marcossit

 

It is working for me, but the default media player buttons like play, pause and seek bar of player is not coming.

 

How can i get these, please suggest.

 

Thanks in advance.

Please use plain text.
Developer
lakshman9687
Posts: 226
Registered: ‎07-22-2011
My Carrier: AirTel

Re: Open video url in default media player.

Thanks marcossit,

 

I am able to play your url, but in my case im getting some yputube url from the service dynamically for those videos are not playing . i.e only blank screen is appering nothing is comming. can you suggest me how to play these type of links.

 

Thanks in advance,

 

Regards,

Lakshman K

----------------------------------------------------------
Feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.

Please use plain text.
Trusted Contributor
kunal_one
Posts: 121
Registered: ‎12-23-2012
My Carrier: wifi

Re: Open video url in default media player.

using MediaPlayer API you wll have to draw your own playback control. I think if you use QDesktopService API, then it will open video with default player. there you will have all playback control.

 

Please use plain text.
Developer
hemant_sain
Posts: 106
Registered: ‎12-09-2011
My Carrier: Aircel

Re: Open video url in default media player.

Thanks marcossit

 

Your code is working good for the url that you give but i want to play youtube url i am passing youtube url but for this it is not working.

 

Please provide any suggestion.

 

Thanks in advance.

Please use plain text.