This is in reference to Mark Murphy's topic at StackOverflow:

http://stackoverflow.com/questions/12920429/anyone-have-mediaplayer-working-with-parcelfiledescriptor-and-createpipe

I tried to post the following there but someone deleted it.  As I'm not
sure why I figured I'll try to get some insights here before I give up.

I've got code in my ContentProvider that's very similar to Mark's, except
that I implement the openAssetFile() function of my ContentProvider, not
openFile(), because I use the setDataSource(FileDescriptor fd, long offset,
long length) overload to pass data to MediaPlayer, and AssetFileDescriptor
returned by openAssetFile() gives me a nice way to get all the arguments.

I've tried to work around the problem by opening the .ogg asset via
openFd() and getting the length from it. I return an AssetFileDescriptor
with a zero offset and the length of the asset (so, no longer -1, or
AssetFileDescriptor.UNKNOWN_LENGTH).

Based on the thoughts from the StackOverflow discussion, I thought this
could fool MediaPlayer into playing the clip - unfortunately, it does not.
I made an attempt to dig into platform sources to see if I could get any
insights there but I'm still not sure where the problem is.

I'm wondering if anyone has made any progress with this?

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to android-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to