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.

inside custom component

Native Development

Reply
Developer
Posts: 180
Registered: ‎12-09-2011
My Device: 9360, BB10

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

Developer
Posts: 178
Registered: ‎07-19-2012
My Device: Z10 Limited Edition and Dev Alpha C

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


Follow me in Twitter:

@Marcossit

BBM Channel:

MarcossitDev: C0002C366  

DeviceSuite For BlackBerry 10:

Link to Download DeviceSuite:

Support was successful? Accept as Solution and click on:


Developer
Posts: 145
Registered: ‎12-23-2012
My Device: BB10 Dev Alpha

Re: Open video url in default media player.

try QDesktopService API.

 

 QDesktopServices::openUrl(QUrl(url));
Developer
Posts: 180
Registered: ‎12-09-2011
My Device: 9360, BB10

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.

Developer
Posts: 243
Registered: ‎07-22-2011
My Device: BlackBerry Z10

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.

Developer
Posts: 145
Registered: ‎12-23-2012
My Device: BB10 Dev Alpha

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.

 

Developer
Posts: 180
Registered: ‎12-09-2011
My Device: 9360, BB10

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.

Retired
Posts: 127
Registered: ‎02-27-2012
My Device: Bold

Re: Open video url in default media player.

Hi @

Application Development Consultant | Developer Relations

BlackBerry
@surashid