summaryrefslogtreecommitdiff
path: root/core/java/android/webkit/HTML5VideoView.java
diff options
context:
space:
mode:
authorTeng-Hui Zhu <ztenghui@google.com>2011-05-11 11:04:40 -0700
committerTeng-Hui Zhu <ztenghui@google.com>2011-05-12 13:53:48 -0700
commit64855da755e74676af49b3c7ece338acd72b2f3c (patch)
tree01dcf3d5eb53c1bc59a63e65a0df7d3a58542b21 /core/java/android/webkit/HTML5VideoView.java
parentf3cdea937b8b659f959d5e77f4a17f749f85c6ae (diff)
Fix the Uri parsing issue
Switching back to use the setDataSource with Uri, which can handle both the file and http path correctly. Change-Id: I5bfc1d01a8de0a4f8640ffceafbc17984833097a
Diffstat (limited to 'core/java/android/webkit/HTML5VideoView.java')
-rw-r--r--core/java/android/webkit/HTML5VideoView.java7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/java/android/webkit/HTML5VideoView.java b/core/java/android/webkit/HTML5VideoView.java
index fd3f358731db..c05498a0fb49 100644
--- a/core/java/android/webkit/HTML5VideoView.java
+++ b/core/java/android/webkit/HTML5VideoView.java
@@ -3,6 +3,7 @@ package android.webkit;
import android.graphics.SurfaceTexture;
import android.media.MediaPlayer;
+import android.net.Uri;
import android.util.Log;
import android.view.SurfaceView;
import android.webkit.HTML5VideoViewProxy;
@@ -55,7 +56,7 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener {
protected boolean mAutostart;
// We need to save such info.
- protected String mUri;
+ protected Uri mUri;
protected Map<String, String> mHeaders;
// The timer for timeupate events.
@@ -172,7 +173,7 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener {
public void setVideoURI(String uri, HTML5VideoViewProxy proxy) {
// When switching players, surface texture will be reused.
- mUri = uri;
+ mUri = Uri.parse(uri);
mHeaders = generateHeaders(uri, proxy);
}
@@ -207,7 +208,7 @@ public class HTML5VideoView implements MediaPlayer.OnPreparedListener {
// When there is exception, we could just bail out silently.
// No Video will be played though. Write the stack for debug
try {
- mPlayer.setDataSource(mUri, mHeaders);
+ mPlayer.setDataSource(mProxy.getContext(), mUri, mHeaders);
mPlayer.prepareAsync();
} catch (IllegalArgumentException e) {
e.printStackTrace();