Only changes the keep playing status if different
This commit is contained in:
@@ -883,13 +883,17 @@ fun ControlWhenPlayerIsActive(
|
|||||||
override fun onIsPlayingChanged(isPlaying: Boolean) {
|
override fun onIsPlayingChanged(isPlaying: Boolean) {
|
||||||
// doesn't consider the mutex because the screen can turn off if the video
|
// doesn't consider the mutex because the screen can turn off if the video
|
||||||
// being played in the mutex is not visible.
|
// being played in the mutex is not visible.
|
||||||
view.keepScreenOn = isPlaying
|
if (view.keepScreenOn != isPlaying) {
|
||||||
|
view.keepScreenOn = isPlaying
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
controller.addListener(listener)
|
controller.addListener(listener)
|
||||||
onDispose {
|
onDispose {
|
||||||
view.keepScreenOn = false
|
if (view.keepScreenOn) {
|
||||||
|
view.keepScreenOn = false
|
||||||
|
}
|
||||||
controller.removeListener(listener)
|
controller.removeListener(listener)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user