Skip to content

fix!: Change the default value of iOS audio context to force speakers#1363

Merged
spydon merged 2 commits into
mainfrom
luan.change-default
Jan 1, 2023
Merged

fix!: Change the default value of iOS audio context to force speakers#1363
spydon merged 2 commits into
mainfrom
luan.change-default

Conversation

@luanpotter

Copy link
Copy Markdown
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
Copy Markdown
Member Author

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

@spydon

spydon commented Dec 31, 2022

Copy link
Copy Markdown
Member

Woooop woop! 🍻😍

@Gustl22

Gustl22 commented Jan 1, 2023

Copy link
Copy Markdown
Collaborator

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

spydon commented Jan 1, 2023

Copy link
Copy Markdown
Member

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.

3 participants