Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd8feeef authored by Jamie Gennis's avatar Jamie Gennis
Browse files

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
parent b283dc64
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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,