mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +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:
@@ -11,24 +11,12 @@ class MediaPlayerProvider: MediaPlayerProviderProtocol {
|
||||
private lazy var audioPlayer = AudioPlayer()
|
||||
private var audioPlayerStates: [String: AudioPlayerState] = [:]
|
||||
|
||||
var player: AudioPlayerProtocol { audioPlayer }
|
||||
|
||||
deinit {
|
||||
audioPlayerStates = [:]
|
||||
}
|
||||
|
||||
func player(for mediaSource: MediaSourceProxy) -> Result<MediaPlayerProtocol, MediaPlayerProviderError> {
|
||||
guard let mimeType = mediaSource.mimeType else {
|
||||
MXLog.error("Unknown mime type")
|
||||
return .failure(.unsupportedMediaType)
|
||||
}
|
||||
|
||||
if mimeType.starts(with: "audio/") {
|
||||
return .success(audioPlayer)
|
||||
} else {
|
||||
MXLog.error("Unsupported media type: \(mediaSource.mimeType ?? "unknown")")
|
||||
return .failure(.unsupportedMediaType)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - AudioPlayer
|
||||
|
||||
func playerState(for id: AudioPlayerStateIdentifier) -> AudioPlayerState? {
|
||||
|
||||
Reference in New Issue
Block a user