diff --git a/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt b/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt index 54377e6ff6..ef13c0e5ae 100644 --- a/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt +++ b/app/src/main/java/com/github/libretube/ui/views/CustomExoPlayerView.kt @@ -172,16 +172,10 @@ internal class CustomExoPlayerView( ) ) { updatePlayPauseButton() - } - } - override fun onPlaybackStateChanged(playbackState: Int) { - // keep the screen on if the video is not ended or paused - keepScreenOn = !( - listOf(Player.STATE_IDLE, Player.STATE_ENDED) - .contains(playbackState) - ) - super.onPlaybackStateChanged(playbackState) + // keep screen on if the video is playing + keepScreenOn = player.isPlaying == true + } } })