mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-10-26 16:50:19 +00:00
fix(ios): keep background music playing during remote sessions (#16660)
Configure the iOS audio session with the ambient category so remote playback mixes with other apps while respecting Silent mode and lock. Log configuration errors and leave audio activation to playback. Signed-off-by: Rafal <mrsikorarafal@gmail.com>
This commit is contained in:
1 parent
828d1101af
commit
398364fa18
1 file changed
+7
@@ -1,5 +1,6 @@
|
||||
import UIKit
|
||||
import Flutter
|
||||
import AVFoundation
|
||||
|
||||
@main
|
||||
@objc class AppDelegate: FlutterAppDelegate {
|
||||
@@ -8,6 +9,12 @@ import Flutter
|
||||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||
) -> Bool {
|
||||
GeneratedPluginRegistrant.register(with: self)
|
||||
do {
|
||||
// Mix remote audio with other apps while still respecting silent mode.
|
||||
try AVAudioSession.sharedInstance().setCategory(.ambient)
|
||||
} catch {
|
||||
NSLog("Failed to configure audio mixing: %@", error.localizedDescription)
|
||||
}
|
||||
dummyMethodToEnforceBundling();
|
||||
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user