Android VideoView black screen

前端 未结 22 2105
清歌不尽
清歌不尽 2020-11-27 12:55

I have been looking for a way to get rid of the nasty black initial screen on a VideoView before the start() method is run.

I have tried with background image on the

22条回答
  •  清歌不尽
    2020-11-27 13:26

    This worked for me:

    videoView.setBackgroundColor(Color.WHITE); // Your color.
    videoView.start();
    videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
        @Override
        public void onPrepared(MediaPlayer mp) {
            videoView.setBackgroundColor(Color.TRANSPARENT);
        }
    });
    

    At least two years later, but I hope that was helpful.

提交回复
热议问题