Resolving wakelock on play interuptions

This commit is contained in:
Kelvin 2024-01-12 23:22:49 +01:00
parent 8964dc68f0
commit 9b48664de4
3 changed files with 11 additions and 1 deletions

View File

@ -1857,7 +1857,7 @@ class VideoDetailView : ConstraintLayout {
} }
} }
private fun handlePlayChanged(playing: Boolean) { private fun c(playing: Boolean) {
Logger.i(TAG, "handlePlayChanged(playing=$playing)") Logger.i(TAG, "handlePlayChanged(playing=$playing)")
val ad = StateCasting.instance.activeDevice; val ad = StateCasting.instance.activeDevice;

View File

@ -629,6 +629,7 @@ class FutoVideoPlayer : FutoVideoPlayerBase {
} }
} }
override fun onPlay
override fun onPlaybackStateChanged(playbackState: Int) { override fun onPlaybackStateChanged(playbackState: Int) {
Logger.v(TAG, "onPlaybackStateChanged $playbackState"); Logger.v(TAG, "onPlaybackStateChanged $playbackState");
updatePlayPause() updatePlayPause()

View File

@ -100,6 +100,15 @@ abstract class FutoVideoPlayerBase : RelativeLayout {
private var _toResume = false; private var _toResume = false;
private val _playerEventListener = object: Player.Listener { private val _playerEventListener = object: Player.Listener {
override fun onPlaybackSuppressionReasonChanged(playbackSuppressionReason: Int) {
super.onPlaybackSuppressionReasonChanged(playbackSuppressionReason)
}
override fun onIsPlayingChanged(isPlaying: Boolean) {
super.onIsPlayingChanged(isPlaying);
updatePlaying();
}
//TODO: Figure out why this is deprecated, and what the alternative is. //TODO: Figure out why this is deprecated, and what the alternative is.
override fun onPlaybackStateChanged(playbackState: Int) { override fun onPlaybackStateChanged(playbackState: Int) {
super.onPlaybackStateChanged(playbackState) super.onPlaybackStateChanged(playbackState)