diff --git a/Source/SwiftyCamViewController.swift b/Source/SwiftyCamViewController.swift index 1c1a8b5..7d337de 100644 --- a/Source/SwiftyCamViewController.swift +++ b/Source/SwiftyCamViewController.swift @@ -1016,9 +1016,13 @@ open class SwiftyCamViewController: UIViewController { } do{ - try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, - with: [.duckOthers, .defaultToSpeaker]) - + if #available(iOS 10.0, *) { + try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, + with: [.mixWithOthers, .allowBluetooth, .allowAirPlay, .allowBluetoothA2DP]) + } else { + try AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayAndRecord, + with: [.mixWithOthers, .allowBluetooth]) + } session.automaticallyConfiguresApplicationAudioSession = false } catch {