mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-27 23:40:33 +05:30
Merge pull request #2886 from praveenrajput/master
Keep screen on only while video is playing #2877
This commit is contained in:
commit
30d6920fd1
@ -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
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user