mirror of
https://github.com/element-hq/element-android
synced 2024-11-27 03:48:12 +03: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
1 changed files with 5 additions and 0 deletions
|
@ -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 a new issue