2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AndroidのVideoViewで最初と最後に入る黒いチラつきを失くす

Posted at

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で覆っている。
これでいいのかな…という気分になった

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?