Refactors keepScreenOn method

This commit is contained in:
Praveen Rajput 2023-01-29 11:08:33 +05:30
parent 6795026a94
commit 2fcaea9ad6

View File

@ -172,7 +172,9 @@ internal class CustomExoPlayerView(
) )
) { ) {
updatePlayPauseButton() updatePlayPauseButton()
updateScreenOnState()
// keep screen on if the video is playing
keepScreenOn = player.isPlaying == true
} }
} }
}) })
@ -186,11 +188,6 @@ internal class CustomExoPlayerView(
} }
} }
private fun updateScreenOnState() {
// keep screen on if the video is playing
keepScreenOn = player?.isPlaying == true
}
private fun updatePlayPauseButton() { private fun updatePlayPauseButton() {
binding.playPauseBTN.setImageResource( binding.playPauseBTN.setImageResource(
when { when {