Fix: the duration of voice messages is now expressed in milliseconds (#1904)

This commit is contained in:
Nicolas Mauri 2023-10-16 10:59:45 +02:00 committed by GitHub
parent 20143cb84e
commit 39e3328b02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -127,7 +127,7 @@ class AudioPlayer: NSObject, AudioPlayerProtocol {
func seek(to progress: Double) async {
guard let internalAudioPlayer else { return }
let time = progress * duration
await internalAudioPlayer.seek(to: CMTime(seconds: time, preferredTimescale: 60000))
await internalAudioPlayer.seek(to: CMTime(seconds: time, preferredTimescale: 60))
}
// MARK: - Private

View File

@ -475,7 +475,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
}
return AudioRoomTimelineItemContent(body: messageContent.body,
duration: (messageContent.audio?.duration ?? 0) / 1000.0,
duration: messageContent.audio?.duration ?? 0,
waveform: waveform,
source: MediaSourceProxy(source: messageContent.source, mimeType: messageContent.info?.mimetype),
contentType: UTType(mimeType: messageContent.info?.mimetype, fallbackFilename: messageContent.body))