diff --git a/relax.offline.mp3.music/AppDelegate.swift b/relax.offline.mp3.music/AppDelegate.swift index b20476f..4b48d6d 100644 --- a/relax.offline.mp3.music/AppDelegate.swift +++ b/relax.offline.mp3.music/AppDelegate.swift @@ -47,7 +47,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { let session = AVAudioSession.sharedInstance() do { //允许后台活跃,播放以及记录 - try session.setCategory(.playAndRecord, mode: .default, options: [.allowBluetooth, .defaultToSpeaker]) + try session.setCategory(.playAndRecord,mode: .default, options: [.mixWithOthers, .allowAirPlay, .allowBluetoothA2DP,.defaultToSpeaker]) //激活会话 try session.setActive(true) // try session.overrideOutputAudioPort(.speaker)