Only changes the keep playing status if different

pull/821/head
Vitor Pamplona 2024-04-01 15:25:49 -04:00
rodzic 38d1bf9aec
commit 469b9c6acb
1 zmienionych plików z 6 dodań i 2 usunięć

Wyświetl plik

@ -883,13 +883,17 @@ fun ControlWhenPlayerIsActive(
override fun onIsPlayingChanged(isPlaying: Boolean) {
// doesn't consider the mutex because the screen can turn off if the video
// being played in the mutex is not visible.
view.keepScreenOn = isPlaying
if (view.keepScreenOn != isPlaying) {
view.keepScreenOn = isPlaying
}
}
}
controller.addListener(listener)
onDispose {
view.keepScreenOn = false
if (view.keepScreenOn) {
view.keepScreenOn = false
}
controller.removeListener(listener)
}
}