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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
samuels007
Posts: 21
Registered: ‎02-11-2009

An occurred attempting to play media in 9530 simulator

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.

thanks

 

Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008

Re: An occurred attempting to play media in 9530 simulator

Following KB aricle shows how to play Video.

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/1089414/How_To...

 

For playing video from the web, are you talking about RTSP server or the generat web server.


Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
Developer
samuels007
Posts: 21
Registered: ‎02-11-2009

Re: An occurred attempting to play media in 9530 simulator

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.

 

thanks

Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008

Re: An occurred attempting to play media in 9530 simulator

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.


Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
Developer
samuels007
Posts: 21
Registered: ‎02-11-2009

Re: An occurred attempting to play media in 9530 simulator

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.

Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008

Re: An occurred attempting to play media in 9530 simulator

Is the other format videos playing? 3gp, avi etc..

Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
Developer
samuels007
Posts: 21
Registered: ‎02-11-2009

Re: An occurred attempting to play media in 9530 simulator

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?

Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008

Re: An occurred attempting to play media in 9530 simulator

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.3gp"

 

 

 


Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
Developer
samuels007
Posts: 21
Registered: ‎02-11-2009

Re: An occurred attempting to play media in 9530 simulator

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.

 try{

            player = Manager.createPlayer("rtsp://stream.the.sk/live/musicbox/musicbox-hm.3gp");
            player.realize();

            //Create a new VideoControl.
            videoControl = (VideoControl)player.getControl("VideoControl");
            //Initialize the video mode using a Field.
             videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");

            //Set the video control to be visible.
            videoControl.setVisible(true);         
        }
        catch (Exception ex)
        {
            System.out.println(ex.toString());
        }

Please help me to solve this issue.

Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008

Re: An occurred attempting to play media in 9530 simulator

I tried on JDE 4.6.0.12 and 9000 Simulator.

 

The JDE version may be the problem. If you have JDE 4.6 give a try.


Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.