Fixed issue with Bluetooth audio being forced onto device

This commit is contained in:
Andrew Walz 2017-09-06 13:24:22 -06:00
parent d837d4d71e
commit 6b8d19620c

View file

@ -1016,9 +1016,13 @@ open class SwiftyCamViewController: UIViewController {
} }
do{ do{
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, if #available(iOS 10.0, *) {
with: [.duckOthers, .defaultToSpeaker]) try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord,
with: [.mixWithOthers, .allowBluetooth, .allowAirPlay, .allowBluetoothA2DP])
} else {
try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord,
with: [.mixWithOthers, .allowBluetooth])
}
session.automaticallyConfiguresApplicationAudioSession = false session.automaticallyConfiguresApplicationAudioSession = false
} }
catch { catch {