Merge "Open file:// Uris on client side of MediaPlayer."

This commit is contained in:
Jeff Sharkey
2013-02-19 23:12:03 +00:00
committed by Android (Google) Code Review

View File

@ -948,7 +948,12 @@ public class MediaPlayer
private void setDataSource(String path, String[] keys, String[] values)
throws IOException, IllegalArgumentException, SecurityException, IllegalStateException {
File file = new File(path);
final Uri uri = Uri.parse(path);
if ("file".equals(uri.getScheme())) {
path = uri.getPath();
}
final File file = new File(path);
if (file.exists()) {
FileInputStream is = new FileInputStream(file);
FileDescriptor fd = is.getFD();