mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-18 20:29:10 +03:00
VB - Stop listening if we reach the last received chunk and there is no last sequence number
This commit is contained in:
parent
e396f6c092
commit
682bb8bde0
1 changed files with 3 additions and 1 deletions
|
@ -419,7 +419,9 @@ class VoiceBroadcastPlayerImpl @Inject constructor(
|
|||
// Next media player is already attached to this player and will start playing automatically
|
||||
if (nextMediaPlayer != null) return
|
||||
|
||||
val hasEnded = !isLiveListening && mostRecentVoiceBroadcastEvent?.content?.lastChunkSequence == playlist.currentSequence
|
||||
val currentSequence = playlist.currentSequence ?: 0
|
||||
val lastChunkSequence = mostRecentVoiceBroadcastEvent?.content?.lastChunkSequence ?: 0
|
||||
val hasEnded = !isLiveListening && currentSequence >= lastChunkSequence
|
||||
if (hasEnded) {
|
||||
// We'll not receive new chunks anymore so we can stop the live listening
|
||||
stop()
|
||||
|
|
Loading…
Add table
Reference in a new issue