Home » Android » java – Getting black screen when added ExoPlayer into GLSurfaceView

java – Getting black screen when added ExoPlayer into GLSurfaceView

Posted by: admin June 15, 2020 Leave a comment

Questions:

I have one GLsurfaceview and video SurfaceView when I added Surfaceview into GLSurfaceView for playing video and result is I am getting black screen instead of video screen. I am getting Audio properly but video screen will not display and it remains black during the whole video.

Both are used for different purpose GLSurfaceView for Page turn while Video surfaceview for ExoPlayer.

GLSurfaceView :

    public class CurlView extends GLSurfaceView implements View.OnTouchListener,
        CurlRenderer.Observer {

        }

Video SurfaceView of ExoPlayer :

    public class VideoSurfaceView extends SurfaceView {


    }
How to&Answers:

Try this For VideoSurfaceView

surfaceView = (VideoSurfaceView) view.findViewById(R.id.surface_view);
surfaceView.getHolder().setFormat(PixelFormat.TRANSLUCENT);
surfaceView.setZOrderOnTop(true);