fix(ios)!: use AVAudioSessionCategory.playAndRecord as default#1501
fix(ios)!: use AVAudioSessionCategory.playAndRecord as default#1501wujek-srujek wants to merge 3 commits into
AVAudioSessionCategory.playAndRecord as default#1501Conversation
BREAKING CHANGE: `AudioContextIOS.category` default value changes.
|
Thanks. If breaking I would want to wait for the next major release and also ensure, if we could make Until then this config should fulfill your needs: |
AVAudioSessionCategory.playAndRecord as default
|
I think it's fine to use the |
|
@wujek-srujek can you validate if you can play the sound through the headphones, if using |
|
Unfortunately I won't be able to do it for about 3 more weeks due to vacation and very limited connectivity (and no computer), but will get to it afterwards. |
Discussion in #1486 shows that this is probably not the right default value.
|
As stated here (#1545 (comment)) earpeace only is equal to |
# 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
|
This should now be solved in #1563. We would be glad if you could verify. Feel free to reopen, if the issue isn't solved. |
Description
Now if ducking is requested, iOS doesn't crash. Also, the default instance of
AudioContextIOSin Dart corresponds to the one in Swift, making the feature consistent.Checklist
fix:,feat:,docs:,chore:etc).///, where necessary.Breaking Change
Yes, it is a breaking change because it changes the default value for the audio category on iOS if the user doesn't specify it explicitly when creating a new
AudioContextIOS.Migration instructions
If the user wants the category to be
playback, they need to set it explicitly.Before:
After:
Related Issues
Closes #1491