mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:31:27 +00:00
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:
@@ -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(())
|
||||
|
||||
Reference in New Issue
Block a user