Skip to content
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!: Change the default value of iOS audio context to force speakers #1363

Merged
merged 2 commits into from Jan 1, 2023

Conversation

luanpotter
Copy link
Member

Description

There has been a high number of issues being opened around the fact that on 1.0.0, forceSpeaker on iOS (and android) was set to false by default, requiring most users to explicitly setup the global audio context.

This change the default value of iOS audio context to force speakers to be inline with what users seem to expect.

Follow this thread for details.

Since I only test iOS on emulators, where this setting doesn't make any difference, I hadn't realized this issue.

Note: this changes the default for android as well, which is in line with the unified audio context philosophy.

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs:, chore: etc).
  • I have read the Contributor Guide and followed the process outlined for submitting PRs.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation and added dartdoc comments with ///, where necessary.
  • I have updated/added relevant examples in example.

Breaking Change

  • Yes, this is a breaking change.
  • No, this is not a breaking change.

Migration instructions

If you wanted to have it set to false, you can just set it so:

      final AudioContext audioContext = AudioContext(
        iOS: AudioContextIOS(
          defaultToSpeaker: false,
         // ...
        ),
        // ...
      );
      AudioPlayer.global.setGlobalAudioContext(audioContext);

If not, you can remove all the ad-hoc code you had to set this up.

Related Issues

@luanpotter
Copy link
Member Author

Tested on iOS emulator, seem to be working just as before.

@spydon
Copy link
Member

spydon commented Dec 31, 2022

Woooop woop! 🍻😍

@Gustl22
Copy link
Collaborator

Gustl22 commented Jan 1, 2023

Do we have any possibility to test this on a real device @luanpotter?
We may could ask in the thread, to test this branch(?).
I for myself managed to get it running on a real ipad compliling via MacOS VM. But that doesn't have an Earpeace, so there's no difference noticable in changing the settings.
Or we just try out the change and see if anyone complains after the release?

I'm fine with the change though, better than doing nothing about it ;)

@spydon
Copy link
Member

spydon commented Jan 1, 2023

Do we have any possibility to test this on a real device @luanpotter?

He doesn't.

We may could ask in the thread, to test this branch(?). I for myself managed to get it running on a real ipad compliling via MacOS VM. But that doesn't have an Earpeace, so there's no difference noticable in changing the settings. Or we just try out the change and see if anyone complains after the release?

I'll do a release and tell people in the thread to try, we can just roll it back and do a new release if some iPhone's explode. 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants