Fix audio session setup for camera

This commit is contained in:
Ilya Laktyushin 2023-06-28 10:42:42 +02:00
parent c38c6827d6
commit b91019c56e

View File

@ -778,21 +778,21 @@ public final class ManagedAudioSession: NSObject {
options.insert(.allowBluetooth) options.insert(.allowBluetooth)
options.insert(.allowBluetoothA2DP) options.insert(.allowBluetoothA2DP)
options.insert(.mixWithOthers) options.insert(.mixWithOthers)
case .record, .recordWithOthers: case .record:
options.insert(.allowBluetooth) options.insert(.allowBluetooth)
case .recordWithOthers:
options.insert(.allowBluetoothA2DP)
options.insert(.mixWithOthers)
} }
managedAudioSessionLog("ManagedAudioSession setting category and options") managedAudioSessionLog("ManagedAudioSession setting category and options")
let mode: AVAudioSession.Mode let mode: AVAudioSession.Mode
switch type { switch type {
case .voiceCall: case .voiceCall:
mode = .voiceChat mode = .voiceChat
options.insert(.mixWithOthers)
case .videoCall: case .videoCall:
mode = .videoChat mode = .videoChat
options.insert(.mixWithOthers)
case .recordWithOthers: case .recordWithOthers:
mode = .videoRecording mode = .videoRecording
options.insert(.mixWithOthers)
default: default:
mode = .default mode = .default
} }