Skip to content

Commit

Permalink
Refactor: Hide buffering after video initilizes (#529)
Browse files Browse the repository at this point in the history
* refactor: hide buffering after first frame rendered

* show and hide buffer on player initilization only
  • Loading branch information
anilbeesetti authored Aug 22, 2023
1 parent c249b2d commit 04cc5d4
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,7 @@ class PlayerActivity : AppCompatActivity() {

private fun initializePlayerView() {
binding.playerView.apply {
setShowBuffering(PlayerView.SHOW_BUFFERING_ALWAYS)
player = this@PlayerActivity.player
controllerShowTimeoutMs = playerPreferences.controllerAutoHideTimeout.toMillis
setControllerVisibilityListener(
Expand Down Expand Up @@ -574,6 +575,7 @@ class PlayerActivity : AppCompatActivity() {

override fun onRenderedFirstFrame() {
isFirstFrameRendered = true
binding.playerView.setShowBuffering(PlayerView.SHOW_BUFFERING_NEVER)
super.onRenderedFirstFrame()
}

Expand Down

0 comments on commit 04cc5d4

Please sign in to comment.