Be able to pause the playback when it is buffering

This commit is contained in:
Philippe Loriaux
2022-11-29 16:21:00 +01:00
parent 13bccafc21
commit d834ac016f
7 changed files with 64 additions and 11 deletions
@@ -137,6 +137,9 @@ class VoiceBroadcastPlaybackViewModel: VoiceBroadcastPlaybackViewModelType, Voic
if let audioPlayer = audioPlayer, audioPlayer.isPlaying {
audioPlayer.pause()
} else {
state.playbackState = .paused
state.playingState.isLive = false
}
}
@@ -380,8 +383,7 @@ extension VoiceBroadcastPlaybackViewModel: VoiceBroadcastAggregatorDelegate {
updateDuration()
if state.playbackState != .stopped {
handleVoiceBroadcastChunksProcessing()
if state.playbackState != .stopped, (state.playbackState != .paused && isActuallyPaused == true) { handleVoiceBroadcastChunksProcessing()
}
}
}