Fix seek when playlist is not loaded

This commit is contained in:
Florian Renaud 2022-11-04 18:49:10 +01:00
parent a320155546
commit 43a112839f
1 changed files with 8 additions and 6 deletions

View File

@ -358,12 +358,14 @@ class VoiceBroadcastPlayerImpl @Inject constructor(
playbackTicker = null playbackTicker = null
val totalDuration = playlist.duration val totalDuration = playlist.duration
val playbackTime = playbackTracker.getPlaybackTime(id) if (totalDuration > 0) {
val remainingTime = totalDuration - playbackTime val playbackTime = playbackTracker.getPlaybackTime(id)
if (remainingTime < 1000) { val remainingTime = totalDuration - playbackTime
playbackTracker.updatePausedAtPlaybackTime(id, 0, 0f) if (remainingTime < 1000) {
} else { playbackTracker.updatePausedAtPlaybackTime(id, 0, 0f)
playbackTracker.pausePlayback(id) } else {
playbackTracker.pausePlayback(id)
}
} }
} }
} }