deactivateAudioSession method
Deactivates the current platform audio session and switches to manual mode.
Like setAudioSessionOptions, calling this puts AudioManager in AudioSessionManagementMode.manual so LiveKit does not re-activate the session on its own. Re-apply a configuration with setAudioSessionOptions, or hand control back with setAudioSessionManagementMode.
Implementation
Future<void> deactivateAudioSession() async {
await _enterManualMode();
if (lkPlatformIs(PlatformType.iOS)) {
await Native.deactivateAppleAudioSession();
} else if (lkPlatformIs(PlatformType.android)) {
await Native.stopAndroidAudioSession();
}
}