mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-11-04 08:34:12 +00:00
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>
27 lines
826 B
Swift
27 lines
826 B
Swift
import UIKit
|
|
import Flutter
|
|
import AVFoundation
|
|
|
|
@main
|
|
@objc class AppDelegate: FlutterAppDelegate {
|
|
override func application(
|
|
_ application: UIApplication,
|
|
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)
|
|
}
|
|
|
|
public func dummyMethodToEnforceBundling() {
|
|
dummy_method_to_enforce_bundling();
|
|
session_get_rgba(nil, 0);
|
|
}
|
|
}
|