Restart the playback time if player completed with less than 250 ms remaining time

This commit is contained in:
Florian Renaud 2023-01-19 17:53:06 +01:00
parent b47c8aabcd
commit 23801de992

View file

@ -517,7 +517,8 @@ class VoiceBroadcastPlayerImpl @Inject constructor(
} }
} }
State.Idle -> { State.Idle -> {
if (playbackTime == null || percentage == null || (playlist.duration - playbackTime) < 50) { // restart the playback time if player completed with less than 250 ms remaining time
if (playbackTime == null || percentage == null || (playlist.duration - playbackTime) < 250) {
playbackTracker.stopPlayback(id) playbackTracker.stopPlayback(id)
} else { } else {
playbackTracker.updatePausedAtPlaybackTime(id, playbackTime, percentage) playbackTracker.updatePausedAtPlaybackTime(id, playbackTime, percentage)