import android.graphics.SurfaceTexture;
import android.media.MediaPlayer;
+import android.net.Uri;
import android.util.Log;
import android.view.SurfaceView;
import android.webkit.HTML5VideoViewProxy;
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.
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);
}
// 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();