mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-01-26 17:14:59 +01:00
Stop playback if live broadcast has ended and there is no more chunk to listen
This commit is contained in:
parent
4be954eeeb
commit
c2d5908542
@ -376,6 +376,11 @@ class VoiceBroadcastPlayerImpl @Inject constructor(
|
||||
// Notify live mode change to all the listeners attached to the current voice broadcast id
|
||||
listeners[voiceBroadcastId]?.forEach { listener -> listener.onLiveModeChanged(isLiveListening) }
|
||||
}
|
||||
|
||||
// Live has ended and last chunk has been reached, we can stop the playback
|
||||
if (!isLiveListening && playingState == State.BUFFERING && playlist.currentSequence == mostRecentVoiceBroadcastEvent?.content?.lastChunkSequence) {
|
||||
stop()
|
||||
}
|
||||
}
|
||||
|
||||
private fun onNextMediaPlayerStarted(mp: MediaPlayer) {
|
||||
|
Loading…
Reference in New Issue
Block a user