04-24-2009 02:02 AM
Hi All, i am tryng to play a vide file (avi) using the native media application.but im getting the error message "An occurred attempting to play media". i tried renaming the file extension from avi to wmv and 3gp using command prompt still the same error is displayed. Also if any one can give me some code sample for streaming of video from a web site within my application will be of great help.
04-24-2009 02:20 AM
Following KB aricle shows how to play Video.
For playing video from the web, are you talking about RTSP server or the generat web server.
04-24-2009 02:45 AM
Thanks for your reply BBDev. I went throught the KB article you had posted. It shows how to play a video file which is stored in a SD card or from a web server. I would like to know if this code be sufficient for streaming of videos from a website which shares the video content on request. The sample code in the article says it will accept any valid URLs which has media content. In that case if i set the Youtube URL of a video will this code work fine? Please explain on RTSP too.
04-24-2009 02:59 AM
Yes, you should be able to play the media file from the web or stored on the SDcard. Even the url of the you tube should be able play only thing is that the device which you trying to play should support the protocol.
RTSP is real time streaming protocol. You can google around you get very use ful info.
04-24-2009 03:27 AM
I am not able to play the video file(wmv) using the sample code in the KB article also.
My Simulator model is storm 9530 and i have created my SD card directory as D:/Share/SDCard. inside SDCard folder i copied the video file.
In the sample code i replaced as, player = Manager.createPlayer("file:///SDCard/Trailer.wmv");
But the video is not getting played and im not getting any exception also. The page remains same as press "SPACE BAR" as per the KB article. Please help me.
04-24-2009 04:22 AM
No even the other formats are also not playing.
As per the supported format article, wmv avi and 3gp are supported for this model.
Do i need to add this video file to my project folder? (hope not required)
i can EXPLORE the SD card which i had created using the media application EXPLORE option also.
Does the path i mentioned is correct?
04-24-2009 04:34 AM
No need of adding to your project.
As you mentioned earlier, it is not throwing any exception also so the path and other things are correct.
I tried the example and it is working fine.
I used thes URL to test "rtsp://stream.the.sk/live/musicbox/musicbox-hm.3g
04-24-2009 04:50 AM
I tried the URL that u had mentioned, but im getting the following error while debugging. "javax.microedition.media.MediaException: Unsupported type." Does this mean that the 3gp is not supported? it catches exception in the create player line itself.
player = Manager.createPlayer("rtsp://stream.the.sk/live/mu
//Create a new VideoControl.
videoControl = (VideoControl)player.getControl("VideoControl");
//Initialize the video mode using a Field.
//Set the video control to be visible.
catch (Exception ex)
Please help me to solve this issue.
04-24-2009 06:38 AM
I tried on JDE 184.108.40.206 and 9000 Simulator.
The JDE version may be the problem. If you have JDE 4.6 give a try.