Code example for MediaPlayer

Methods: setSurface

0
        } 
 
        void useAsSinkForJava(MediaPlayer mediaPlayer) {
            SurfaceTexture st = mMyGLSurfaceView.getSurfaceTexture();
            Surface s = new Surface(st);
            mediaPlayer.setSurface(s);
            s.release();
        } 
 
        void useAsSinkForNative() { 
            setSurfaceTexture(mMyGLSurfaceView.getSurfaceTexture());
        } 
 
    } 
 
}