Fix playback scrubbing not working if playback is stopped
This commit is contained in:
parent
6b98b3023e
commit
960bb77c2f
1
changelog.d/7961.bugfix
Normal file
1
changelog.d/7961.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Voice Broadcast - Fix playback scrubbing not working if the playback is in a stopped state
|
@ -182,15 +182,16 @@ class VoiceBroadcastPlayerImpl @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
State.Buffering -> {
|
State.Buffering -> {
|
||||||
val nextItem = if (isLiveListening && playlist.currentSequence == null) {
|
val savedPosition = currentVoiceBroadcast?.voiceBroadcastId?.let { playbackTracker.getPlaybackTime(it) }
|
||||||
// live listening, jump to the last item if playback has not started
|
when {
|
||||||
playlist.lastOrNull()
|
// resume playback from the next sequence item
|
||||||
} else {
|
playlist.currentSequence != null -> playlist.getNextItem()?.let { startPlayback(it.startTime) }
|
||||||
// not live or playback already started, request next item
|
// resume playback from the saved position, if any
|
||||||
playlist.getNextItem()
|
savedPosition != null -> startPlayback(savedPosition)
|
||||||
}
|
// live listening, jump to the last item
|
||||||
if (nextItem != null) {
|
isLiveListening -> playlist.lastOrNull()?.let { startPlayback(it.startTime) }
|
||||||
startPlayback(nextItem.startTime)
|
// start playback from the beginning
|
||||||
|
else -> startPlayback(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
is State.Error -> Unit
|
is State.Error -> Unit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user