HTML5VideoView: switch to MediaPlayer#setSurface

This change updates HTML5VideoView to use the new MediaPlayer#setSurface
method rather than MediaPlayer#setTexture, which is going to be removed.

Change-Id: Ia4c8c822bd4735caf95f3f295485d60f016577c1
This commit is contained in:
Jamie Gennis
2011-08-28 17:33:58 -07:00
parent b283dc64bc
commit fd8feeef49

View File

@@ -5,6 +5,7 @@ import android.graphics.SurfaceTexture;
import android.media.MediaPlayer;
import android.webkit.HTML5VideoView;
import android.webkit.HTML5VideoViewProxy;
import android.view.Surface;
import android.opengl.GLES20;
/**
@@ -38,7 +39,10 @@ public class HTML5VideoInline extends HTML5VideoView{
@Override
public void decideDisplayMode() {
mPlayer.setTexture(getSurfaceTexture(getVideoLayerId()));
SurfaceTexture surfaceTexture = getSurfaceTexture(getVideoLayerId());
Surface surface = new Surface(surfaceTexture);
mPlayer.setSurface(surface);
surface.release();
}
// Normally called immediately after setVideoURI. But for full screen,