Fix a crash when a voice message finishes.

This commit is contained in:
Doug
2022-11-18 16:58:29 +00:00
committed by Doug
parent 9b1e374f3e
commit f1b2d83e8f
2 changed files with 3 additions and 1 deletions
@@ -61,7 +61,8 @@ class VoiceMessageAudioPlayer: NSObject {
}
var currentTime: TimeInterval {
return abs(CMTimeGetSeconds(audioPlayer?.currentTime() ?? .zero))
let currentTime = abs(CMTimeGetSeconds(audioPlayer?.currentTime() ?? .zero))
return currentTime.isFinite ? currentTime : .zero
}
var playerItems: [AVPlayerItem] {