-
Notifications
You must be signed in to change notification settings - Fork 853
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!: Default audio output to system preferences (#1563)
# Description Supersedes #1501 * Introduce `AudioContextConfigRoute` to allow forcing audio to `speaker` or `earpiece` (this can be extended to e.g. bluetooth devices) for both iOS and Android * ios: change default AVAudioSessionCategory from `.playAndRecord` to `.playback` to not play from earpiece as in record mode (see #1194) * ios: remove default `AVAudioSessionOptions.defaultToSpeaker` to allow playing from system default device instead of speaker only (see #1486) * android: change default AudioContextAndroid.isSpeakerphoneOn from `true` to `false` to allow playing from system default device instead of speaker only (see #1486) * ios: remove default `AVAudioSessionOptions.mixWithOthers` to interrupt audio of other apps, like in Android * android: change default AudioContextAndroid.stayAwake from `true` to `false` to not stay awake, like in iOS ## Breaking Change ### Migration instructions |Before|After| |---|---| |`AudioContextAndroid()`|`AudioContextAndroid(isSpeakerphoneOn: true, stayAwake: true)`| |`AudioContextIOS()`|`AudioContextIOS(category: AVAudioSessionCategory.playAndRecord, options: [AVAudioSessionOptions.mixWithOthers, AVAudioSessionOptions.defaultToSpeaker])`| |`AudioContextConfig()`|`AudioContextConfig(route: AudioContextConfigRoute.speaker, stayAwake: true})`| ## Related Issues Closes #1491 Closes #1486 #1194
- Loading branch information
Showing
8 changed files
with
108 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters