Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.

Talk:How to create a YouTube player with Java ME

From Wiki
Jump to: navigation, search


Gaba88 - No Audio On Asha 310

Hi Skalogir,

I have two questions about this article:

1. I tried to use this on Nokia Asha 310 but there was no audio for the youtube link you have posted. 2. I tried with some other rtsp links and that was not working.

so is this a device limitation ?? or we need to change something in videocanvas class.



gaba88 21:06, 21 April 2013 (EEST)

Skalogir - Lack of audio follow up

Hi Gargi,

The lack of audio on Nokia 310 seems to be inherited from the known issue reported for Nokia 311, as these two models are closely related software-wise. I do not see any way around it, as this is caused by lack of proper codec supprt for the given protocol. The Player instance in the case of RTSP can only be created with the URL as the single argument in the createPlayer() method (i.e. you cannot use InputStream). This issue doesn't affect the previous DP1.1, platform, though.

Regarding your second question, please keep in mind that there is a wide selection of online streams that have been encoded with various video and audio codecs. Nokia devices typically support the following video codecs:

H.263, H.264 (BP) and MPEG4 Visual / MPEG4 part 2

and the following audio codecs AAC, AMR

However there are variations from one device to another. Most likely you are tryiing to play an unsupported stream. If you can download the video locally on your system, you can use a tool (e.g. MediaInfo) for analyzing its video and audio components.

skalogir 16:41, 23 April 2013 (EEST)

Gaba88 - Thank, but then why browser is able to play the content ??

Hello Skalogir,

Thanks for your detailed reply and i think there is some problem with audio of both 310 and 311 while streaming the media.

But i have one more question for you , with the code you have posted i am not getting the audio but the same media if play from the nokia browser , the the videoplayer which browser opens i can hear the audio and video both.

Now to be more clear i have a mobile web version of the content which i want to port to a native application, the mobile web video works great i can see it and hear the audio but when i try to use the streaming url using createplayer method than it fails.

So is it the nokia browser is using something different there ??



gaba88 17:56, 23 April 2013 (EEST)

Skalogir - Java ME native versus browser

That's correct. The browser comes with a separate media codec support than the native Java ME environment. You can always launch the browser from within your Java ME application using a PlatformRequest, e.g.


and this will work (both audio and video).

However the actual issue here is the Java ME environment, not the browser, so if you need a more integrated experince, you might have to investigate if you can encode the content you plan on streaming with different audio codec (e.g. AMR). That is provided that you host the content and you don't retrieve it from some place else.

skalogir 09:36, 24 April 2013 (EEST)

Gaba88 - platformrequest not working

Hello Skalogir,

Yes i forgot to mention i tried with platform request but that fails, now you have posted to call it like:


now whats rtps here ?? Is it the way to call rtsp links ??



gaba88 18:31, 24 April 2013 (EEST)

Skalogir - Typo

My bad Gargi,

The correct way to call the method is this: platformRequest("rtsp://");

From a quick test on Nokia 311, this launches the video on browser without any issues. Does this work on your Nokia 310?

skalogir 00:03, 25 April 2013 (EEST)

Hamishwillee - Worth including this option in the body of the document

HI Stratos

A couple of thoughts (only quick scan, so could have it wrong):

  • Sounds like using the platformRequest is a good option for Series 40 where close integration isn't required - worth mentioning
  • There are more things that can go wrong on Series 40 outlined in your comments than in the body of the article (ie w.rt. codecs). Add to "considerations"?

Also abstractis wrong now ... This article explains how to create a YouTube player with Java ME on Nokia Belle devices.

This now covers Series 40 too. IMO Series 40 is now the more important platform. Can this be turned around to be Asha specific with Symbian as the less important. If not, might be worth having separate topics.



hamishwillee 10:10, 25 April 2013 (EEST)

Mponnada - What about the Nokia Asha series?


This mode does not work on Asha, can someone point me to a tutorial where this works on the Nokia Asha sdk 1.0?


mponnada (talk) 13:42, 10 November 2013 (EET)

Skalogir - Rtsp protocol is not currently supported on Asha

Hi Mponnada,

The rtsp:// protocol is currently not supported on Asha (both 1.0 and 1.1), I am afraid. If you try to run this application on the latest Nokia Asha SDK 1.1 you will get the following Media Exception:

Media Exception: Player cannot be created for rtsp:// Unsupported protocol rtsp

skalogir (talk) 16:23, 15 November 2013 (EET)