Handle VoIP buttons when VB is used (#7225)

This commit is contained in:
Phl-Pro
2023-01-10 15:24:46 +01:00
committed by GitHub
parent 3f97f89e0a
commit e2a635f961
8 changed files with 64 additions and 20 deletions
@@ -68,6 +68,10 @@ final class VoiceBroadcastRecorderCoordinator: Coordinator, Presentable {
func pauseRecording() {
voiceBroadcastRecorderViewModel.context.send(viewAction: .pause)
}
func isVoiceBroadcastRecording() -> Bool {
return voiceBroadcastRecorderService.isRecording
}
// MARK: - Private
}
@@ -85,6 +85,14 @@ import Foundation
voiceBroadcastRecorderCoordinatorForCurrentEvent()?.pauseRecording()
}
@objc public func isVoiceBroadcastRecording() -> Bool {
guard let coordinator = voiceBroadcastRecorderCoordinatorForCurrentEvent() else {
return false
}
return coordinator.isVoiceBroadcastRecording()
}
// MARK: - Private
/// Retrieve the voiceBroadcast recorder coordinator for the current event or nil if it hasn't been created yet
@@ -44,6 +44,9 @@ class VoiceBroadcastRecorderService: VoiceBroadcastRecorderServiceProtocol {
// MARK: Public
weak var serviceDelegate: VoiceBroadcastRecorderServiceDelegate?
var isRecording: Bool {
return audioEngine.isRunning
}
// MARK: - Setup
@@ -25,6 +25,9 @@ protocol VoiceBroadcastRecorderServiceProtocol {
/// Service delegate
var serviceDelegate: VoiceBroadcastRecorderServiceDelegate? { get set }
/// Returns if a voice broadcast is currently recording.
var isRecording: Bool { get }
/// Start voice broadcast recording.
func startRecordingVoiceBroadcast()