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

New Developer
New Developer
Posts: 4
Registered: ‎11-18-2009
My Device: Not Specified

Accessing a resource in library cod file



I have been having issues with adding videos to my Blackberry application project. I figured this is due to the .cod file and application size restrictions. To get around this, I have created a new library project and added the 953kb video to the res folder. I have also added the project references of the library project in the main application.


The problem I have is when trying to access a resource in the library project from my a class in my main app I use the following code


InputStream inputStream = getClass().getResourceAsStream("cod:///myRescLib/movie.mp4");

Player player = javax.microedition.media.Manager.createPlayer(inputStream, "video/mp4");


However, I get the msg “the current media cannot be played from the network. Save it first for local playback”

Both cod files exist on the simulator. What am I doing wrong?


The help documents suggests importing the newly created package in the main application to be able to use the classes, but the library has no src files, therefore as I understand it, there is no package to import. Is this correct?

Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Accessing a resource in library cod file

[ Edited ]

As far as I know, you can't put a 953kB file in a cod, maximum size for a file in a cod is 64K.  Are you sure this compiled correctly?