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

Posts: 14
Registered: ‎06-24-2013
My Device: Blackberry Z10 Developer Edition
My Carrier: Wind
Accepted Solution

How to using core mediaplayer for YouTube videos?

Hi all,

I'm trying to use the core mediaplayer to show a YouTube video.


This is the code I wrote:


MyApp::startYoutube(QString uri){

    InvokeRequest cardRequest;




    cardRequest.setMimeType("video/x-youtube"); //also tried with video/mp4 and video/x-flv



    bb::system::InvokeManager invokeMan;




but passing the YouTube url (http://www.youtube.com/v/VIDEO_ID) the invoked card advice me that the format is not supported.


I know that is possible beacause of FastTube app, but I cannot find the solution.

Where is the error?


Thanks in advance.


Please use plain text.
BlackBerry Development Advisor (Retired)
Posts: 127
Registered: ‎02-27-2012
My Device: Bold
My Carrier: Rogers

Re: How to using core mediaplayer for YouTube videos?

Hi @beat84,

The link you are trying to play is basically a URL for the web browser, correct? That is, YouTube would need HTML5 or Flash enabled to show you that content (it shows the custom YouTube player controls correct?). For playing things from YouTube, with this type of format for the URL, you would need to play it within a WebView component if you wanted to use it within a native app. The webkit runtime has its own media player (identical to the one seen through the browser app) which will go fullscreen when user plays the content. You can also take a look at native apps like Nobex Radio or SoundHound which does YouTube video playback through WebView.

For playing content using the core Media Previewer card app (the one you are trying to do below), you would need to know the final destination URL from the server (for example: http://domainName.com/file.mp4). Basically, the server would need to send the encoded media, using a protocol recognized by the BlackBerry 10 multimedia platform.

Hope this helps.


Application Development Consultant | Developer Relations


Please use plain text.
BlackBerry Development Advisor
Posts: 249
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: How to using core mediaplayer for YouTube videos?

[ Edited ]

Replied too soon without a refresh to see Rashid's message :smileyhappy:


Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.