08-12-2008 06:27 AM
I've problems to play a file from sdcard. I looked EmbeddedMediaDemo sample and I changed the line:
//InputStream is = getClass().getResourceAsStream("/media/BlackBerry.
InputStream is = getClass().getResourceAsStream("/SDCard/BlackBerry
and I receive the message :" Uncaught exception stream : null"
I tried also so:
InputStream is = getClass().getResourceAsStream("file:///SDCard/Bla
but same problem
I try to include VID00019.3GP into the proj, then use this line:
InputStream is = getClass().getResourceAsStream("/media/VID00019.3G
it work.
please help-urgent.
thanks
Solved! Go to Solution.
08-12-2008 09:18 AM
Instead of creating an input stream, just pass the URI of the file to Manager.createPlayer
_player = javax.microedition.media.Manager.createPlayer("fil
e:///SDCard/BlackBerry/videos/VID00019.3GP"); _player.addPlayerListener(this); _player.realize();
08-12-2008 09:35 AM
Passing the uri is the easiest way. You can open an input stream from the file system using the FileConnection:
InputStream inputStream = null; FileConnection fileConnection = (FileConnection) Connector.open( "file:///SDCard/BlackBerry/videos/VID00019.3GP"); if (fileConnection.exists()) { inputStream = fconn.openInputStream(); }
08-12-2008 09:41 AM