mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
MESSENGER Release 1.24.0
This commit is contained in:
@@ -70,6 +70,11 @@ class VoiceMessagePlaybackController: VoiceMessageAudioPlayerDelegate, VoiceMess
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(updateTheme), name: .themeServiceDidChangeTheme, object: nil)
|
||||
updateTheme()
|
||||
updateUI()
|
||||
|
||||
if BwiBuildSettings.bwiResignPlayingVoiceMessageInBackground {
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(appMovedToBackground), name: UIApplication.willResignActiveNotification, object: nil)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
var attachment: MXKAttachment? {
|
||||
@@ -219,4 +224,17 @@ class VoiceMessagePlaybackController: VoiceMessageAudioPlayerDelegate, VoiceMess
|
||||
@objc private func updateTheme() {
|
||||
playbackView.update(theme: ThemeService.shared().theme)
|
||||
}
|
||||
|
||||
// bwi: resign voice playing in background
|
||||
@objc func appMovedToBackground() {
|
||||
guard let audioPlayer = audioPlayer else {
|
||||
return
|
||||
}
|
||||
|
||||
if audioPlayer.url != nil {
|
||||
if audioPlayer.isPlaying {
|
||||
audioPlayer.stop()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user