From 23801de9920709db84e18abf2da0f5a20fbee4f2 Mon Sep 17 00:00:00 2001 From: Florian Renaud Date: Thu, 19 Jan 2023 17:53:06 +0100 Subject: [PATCH] Restart the playback time if player completed with less than 250 ms remaining time --- .../voicebroadcast/listening/VoiceBroadcastPlayerImpl.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vector/src/main/java/im/vector/app/features/voicebroadcast/listening/VoiceBroadcastPlayerImpl.kt b/vector/src/main/java/im/vector/app/features/voicebroadcast/listening/VoiceBroadcastPlayerImpl.kt index de059ba991..11b6711b6e 100644 --- a/vector/src/main/java/im/vector/app/features/voicebroadcast/listening/VoiceBroadcastPlayerImpl.kt +++ b/vector/src/main/java/im/vector/app/features/voicebroadcast/listening/VoiceBroadcastPlayerImpl.kt @@ -517,7 +517,8 @@ class VoiceBroadcastPlayerImpl @Inject constructor( } } 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) } else { playbackTracker.updatePausedAtPlaybackTime(id, playbackTime, percentage)