Starting in Android 4.2, processes may have different views of the
filesystem depending on which user they're running as. For example,
"/sdcard/foo.mp3" could refer to different files for different users.
To correctly disambiguate filesystem paths, you'll need to open the
file in your app process and pass the FileDescriptor to the
mediaserver (which is shared between all users on a device).
Something like this should work:
MediaPlayer player;
FileInputStream fis = new FileInputStream(myFile);
try {
player.setDataSource(fis.getFD());
} finally {
fis.close();
}
It sounds like the setDataSource(String path) method needs to be
fixed; tracking in 7962739.
j
On Fri, Feb 15, 2013 at 8:43 AM, Brill Pappin <[email protected]> wrote:
> So I've now tested many different ways to try and figure this out and I need
> to reset the code (as I've introduced some silly errors).
> That error is most definitely a path problem which I need to retest and make
> sure I didn't introduce with my own hacking :)
>
> I *do* know that what was working in 4.1.1 does not work in 4.2.1.
>
> FYI - I'm also now seeing error 19, which is "Error due to general port
> processing" whatever that means.
>
> --
> --
> 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
> ---
> 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 [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
Jeff Sharkey
[email protected]
--
--
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
---
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.