VideoViewの最初と最後に黒い画面が入ってしまう問題の対応
fun startVideo() {
videoView.postDelayed({
videoView.setBackgroundResource(R.color.bland_yellow)
}, videoView.duration.toLong() - 100)
videoView.start()
Handler().postDelayed({
videoView.setBackgroundResource(R.color.bland_clear)
},200)
}
xmlのvideoViewにはあらかじめbackgroundResourceを設定しておく。
要するに再生の最初200msとラスト100msをdrawableで覆っている。
これでいいのかな…という気分になった