#4655 - Allowing voice message playback to be controlled from the lock screen or the control center.

This commit is contained in:
Stefan Ceriu
2021-08-04 16:51:22 +03:00
committed by Stefan Ceriu
parent c4351e1e67
commit 949551c8da
4 changed files with 128 additions and 5 deletions
@@ -45,6 +45,7 @@ class VoiceMessageAudioPlayer: NSObject {
private let delegateContainer = DelegateContainer()
private(set) var url: URL?
private(set) var displayName: String?
var isPlaying: Bool {
guard let audioPlayer = audioPlayer else {
@@ -68,12 +69,13 @@ class VoiceMessageAudioPlayer: NSObject {
removeObservers()
}
func loadContentFromURL(_ url: URL) {
func loadContentFromURL(_ url: URL, displayName: String? = nil) {
if self.url == url {
return
}
self.url = url
self.displayName = displayName
removeObservers()