-
Notifications
You must be signed in to change notification settings - Fork 856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix!: Default audio output to system preferences #1563
Conversation
…behavior of Android
@wujek-srujek @MichaelNZ85 @xxddff @LeoSandbox can you test this branch, if it solves your needs and if it still plays the sound through the speakers (and not the earpiece) by default? You can test this branch by copying this to pubspec.yaml:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm! I wonder how some of these defaults came into play to start with 😅
@luanpotter do you have concerns about the changes? |
I'll physically poke him, we're both at FlutterCon 😄 |
Nice to hear, enjoy your stay 🥳 |
Description
Supersedes #1501
AudioContextConfigRoute
to allow forcing audio tospeaker
orearpiece
(this can be extended to e.g. bluetooth devices) for both iOS and Android.playAndRecord
to.playback
to not play from earpiece as in record mode (see iOS volume very low (sound is coming from earpiece) #1194)AVAudioSessionOptions.defaultToSpeaker
to allow playing from system default device instead of speaker only (see Sound does not play through headphones on Android and iOS devices #1486)true
tofalse
to allow playing from system default device instead of speaker only (see Sound does not play through headphones on Android and iOS devices #1486)AVAudioSessionOptions.mixWithOthers
to interrupt audio of other apps, like in Androidtrue
tofalse
to not stay awake, like in iOSWARNING: I could not test on a real device for iOS, all this is based on experiences of our community linked below!
Checklist
fix:
,feat:
,docs:
,chore:
etc).///
, where necessary.Breaking Change
Migration instructions
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