mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
Voice broadcast connection error handling while recording (#7282)
This commit is contained in:
+18
@@ -116,6 +116,8 @@ class VoiceBroadcastRecorderService: VoiceBroadcastRecorderServiceProtocol {
|
||||
// Discard the service on VoiceBroadcastService error. We keep the service in case of other error type
|
||||
if error as? VoiceBroadcastServiceError != nil {
|
||||
self.tearDownVoiceBroadcastService()
|
||||
} else {
|
||||
AppDelegate.theDelegate().showError(asAlert: error)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -136,6 +138,10 @@ class VoiceBroadcastRecorderService: VoiceBroadcastRecorderServiceProtocol {
|
||||
}
|
||||
}, failure: { error in
|
||||
MXLog.error("[VoiceBroadcastRecorderService] Failed to pause voice broadcast", context: error)
|
||||
// Pause voice broadcast recording without sending pending events.
|
||||
if error is VoiceBroadcastServiceError == false {
|
||||
AppDelegate.theDelegate().showError(asAlert: error)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -151,6 +157,9 @@ class VoiceBroadcastRecorderService: VoiceBroadcastRecorderServiceProtocol {
|
||||
UIApplication.shared.isIdleTimerDisabled = true
|
||||
}, failure: { error in
|
||||
MXLog.error("[VoiceBroadcastRecorderService] Failed to resume voice broadcast", context: error)
|
||||
if error is VoiceBroadcastServiceError == false {
|
||||
AppDelegate.theDelegate().showError(asAlert: error)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -169,6 +178,15 @@ class VoiceBroadcastRecorderService: VoiceBroadcastRecorderServiceProtocol {
|
||||
self.tearDownVoiceBroadcastService()
|
||||
}
|
||||
|
||||
func pauseOnErrorRecordingVoiceBroadcast() {
|
||||
audioEngine.pause()
|
||||
UIApplication.shared.isIdleTimerDisabled = false
|
||||
invalidateTimer()
|
||||
|
||||
// Update state
|
||||
self.serviceDelegate?.voiceBroadcastRecorderService(self, didUpdateState: .error)
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
/// Reset chunk values.
|
||||
private func resetValues() {
|
||||
|
||||
Reference in New Issue
Block a user