Android VideoView black screen

前端 未结 22 2117
清歌不尽
清歌不尽 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 13:23

    Modifying @emmgfx's answer worked for me:

    videoView.setBackgroundColor(Color.WHITE)
    videoView.start()
    Timer().schedule(100){
      videoView?.setBackgroundColor(Color.TRANSPARENT)
    }
    

    Trick is to delay the video view untill video loads. PS : It's kotlin.

提交回复
热议问题