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.

inside custom component

Java Development

Reply
Developer
Blanc
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified
Accepted Solution

Problems with URI

[ Edited ]

 

Hi am trying to play a video. i followed the way given in KB article

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

 

now it is throwing an exception: "Locator does not reference a valid media file", meaning that the path is invalid.

but it is a valid path, and video file is recognizing when i explore it through 'Media'. I placed it on the SDCard.

 

Here is the code that is throwin exception:

        player = javax.microedition.media.Manager.createPlayer("file:///SDCard/BlackBerry/videos/10.3gpp");
            player.realize();

 

 

 

 

Thanks and Regards,
PraveenGoparaju.
Developer
Blanc
Posts: 638
Registered: ‎07-02-2009
My Device: Not Specified

Re: Problems with URI

i did in the following way to solve the issue, but i dont find the reason behind why it is throwing error?

any way my issue is solved now with the following code....

 

 

StreamConnection sc = (StreamConnection)Connector.open("file:///SDCard/BlackBerry/videos/10.3gp");
	    	InputStream is = sc.openDataInputStream();
            player = javax.microedition.media.Manager.createPlayer(is, "video/3gpp");
            player.realize();

 

if any1 find the reason for invalid URI that is of great help.

 

Thanks and Regards,
PraveenGoparaju.