10-16-2013 07:28 AM
I'm trying to use the core mediaplayer to show a YouTube video.
This is the code I wrote:
cardRequest.setMimeType("video/x-youtube"); //also tried with video/mp4 and video/x-flv
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.
Solved! Go to Solution.
10-18-2013 10:13 AM
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
10-18-2013 10:49 AM - edited 10-18-2013 10:51 AM
Replied too soon without a refresh to see Rashid's message