Update the SDK. (#3565)

* Update the SDK.

* Add mockMXC URLs to fix all the crashes during tests.

* Refactor Voice Messages to not use a MediaSource for local files.
This commit is contained in:
Doug
2024-11-28 08:34:38 +00:00
committed by GitHub
parent e70a95cfa2
commit 751be7b3a7
75 changed files with 222 additions and 590 deletions
@@ -101,13 +101,12 @@ class VoiceMessageRecorder: VoiceMessageRecorderProtocol {
await previewAudioPlayerState.attachAudioPlayer(audioPlayer)
}
if audioPlayer.url == url {
if audioPlayer.playbackURL == url {
audioPlayer.play()
return .success(())
}
let pendingMediaSource = MediaSourceProxy(url: url, mimeType: mp4accMimeType)
audioPlayer.load(mediaSource: pendingMediaSource, using: url, autoplay: true)
audioPlayer.load(sourceURL: url, playbackURL: url, autoplay: true)
return .success(())
}
@@ -242,10 +241,7 @@ class VoiceMessageRecorder: VoiceMessageRecorderProtocol {
previewAudioPlayerState = await AudioPlayerState(id: .recorderPreview, title: L10n.commonVoiceMessage, duration: recordingDuration, waveform: EstimatedWaveform(data: []))
// Build the preview audio player
let mediaSource = MediaSourceProxy(url: url, mimeType: mp4accMimeType)
guard case .success(let mediaPlayer) = await mediaPlayerProvider.player(for: mediaSource), let audioPlayer = mediaPlayer as? AudioPlayerProtocol else {
return .failure(.previewNotAvailable)
}
let audioPlayer = await mediaPlayerProvider.player
previewAudioPlayer = audioPlayer
return .success(())