playback: fix ongoing sesson logic
Previous might have risked the state being blown up due to cascading pause changes? Not sure honestly.
This commit is contained in:
parent
93dee00285
commit
6b6fc4d62a
1 changed files with 4 additions and 4 deletions
|
@ -435,16 +435,16 @@ class ExoPlaybackStateHolder(
|
||||||
override fun endSession() {
|
override fun endSession() {
|
||||||
// This session has ended, so we need to reset this flag for when the next
|
// This session has ended, so we need to reset this flag for when the next
|
||||||
// session starts.
|
// session starts.
|
||||||
|
playbackManager.playing(false)
|
||||||
save {
|
save {
|
||||||
// User could feasibly start playing again if they were fast enough, so
|
// User could feasibly start playing again if they were fast enough, so
|
||||||
// we need to avoid stopping the foreground state if that's the case.
|
// we need to avoid stopping the foreground state if that's the case.
|
||||||
if (playbackManager.progression.isPlaying) {
|
if (!playbackManager.progression.isPlaying) {
|
||||||
playbackManager.playing(false)
|
|
||||||
}
|
|
||||||
sessionOngoing = false
|
sessionOngoing = false
|
||||||
playbackManager.ack(this, StateAck.SessionEnded)
|
playbackManager.ack(this, StateAck.SessionEnded)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun reset(ack: StateAck.NewPlayback) {
|
override fun reset(ack: StateAck.NewPlayback) {
|
||||||
player.setMediaItems(listOf())
|
player.setMediaItems(listOf())
|
||||||
|
|
Loading…
Reference in a new issue