Fix: Keep the progress indicator visible after pausing or scrubbing a voice message. (#1969)

This commit is contained in:
Nicolas Mauri
2023-10-27 17:24:22 +02:00
committed by GitHub
parent 0b31446817
commit a32a7c8f2c
12 changed files with 110 additions and 23 deletions
@@ -91,12 +91,15 @@ class VoiceMessageRecorder: VoiceMessageRecorderProtocol {
return .failure(.previewNotAvailable)
}
if await !previewAudioPlayerState.isAttached {
await previewAudioPlayerState.attachAudioPlayer(audioPlayer)
}
if audioPlayer.url == url {
audioPlayer.play()
return .success(())
}
await previewAudioPlayerState.attachAudioPlayer(audioPlayer)
let pendingMediaSource = MediaSourceProxy(url: url, mimeType: mp4accMimeType)
audioPlayer.load(mediaSource: pendingMediaSource, using: url, autoplay: true)
return .success(())