I have a very brief video that I would like to include as a raw
resource in my app. The video plays correctly when loaded from the SD
card in the ApiDemos MediaPlayerDemo_Video example. However, if I
attempt to load it as a raw resource, I get the following error after
calling MediaPlayer.prepare:

12-18 15:23:08.190: ERROR/PlayerDriver(554): Command PLAYER_PREPARE
completed with an error or info PVMFErrResourceConfiguration
12-18 15:23:08.190: ERROR/MediaPlayer(1242): error (1, -16)

The (simplified) code:

AssetFileDescriptor afd = this.getResources().openRawResourceFd
(R.raw.thevideo);
MediaPlayer mp = new MediaPlayer();
try {
        mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(),
afd.getLength());
        afd.close();
        mp.prepare();
} catch (Exception e) {}

What can I be doing wrong?

Thank you in advance.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to