mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-19 16:13:42 +02:00
Simplify scrubbing and reset to stopped if scrub to start/end
This commit is contained in:
@@ -157,19 +157,17 @@ public class VoiceMessageController: NSObject, VoiceMessageToolbarViewDelegate,
|
||||
}
|
||||
}
|
||||
|
||||
func voiceMessageToolbarViewRequestedFormattedTimestamp(for progress: CGFloat) -> String? {
|
||||
guard let duration = recordDuration else {
|
||||
return nil
|
||||
}
|
||||
return VoiceMessageController.elapsedTimeFormatter.string(from: Date(timeIntervalSinceReferenceDate: duration * progress))
|
||||
}
|
||||
|
||||
func voiceMessageToolbarViewDidRequestSeek(to progress: CGFloat) {
|
||||
guard let audioPlayer = audioPlayer,
|
||||
let duration = recordDuration else {
|
||||
return
|
||||
}
|
||||
|
||||
guard progress > 0 else {
|
||||
audioPlayer.stop()
|
||||
return
|
||||
}
|
||||
|
||||
if audioPlayer.url == nil {
|
||||
audioPlayer.loadContentFromURL(temporaryFileURL)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user