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!: Default audio output to system preferences #1563

Merged
merged 10 commits into from
Jul 6, 2023

Conversation

Gustl22
Copy link
Collaborator

@Gustl22 Gustl22 commented Jul 4, 2023

Description

Supersedes #1501

WARNING: I could not test on a real device for iOS, all this is based on experiences of our community linked below!

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

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

@Gustl22
Copy link
Collaborator Author

Gustl22 commented Jul 4, 2023

@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:

dependency_overrides:
  audioplayers:
    git:
      url: https://github.com/bluefireteam/audioplayers.git
      path: 'packages/audioplayers'
      ref: 'gustl22/1486-ios-headphones'
  audioplayers_platform_interface:
    git:
      url: https://github.com/bluefireteam/audioplayers.git
      path: 'packages/audioplayers_platform_interface'
      ref: 'gustl22/1486-ios-headphones'
  audioplayers_web:
    git:
      url: https://github.com/bluefireteam/audioplayers.git
      path: 'packages/audioplayers_web'
      ref: 'gustl22/1486-ios-headphones'
  audioplayers_linux:
    git:
      url: https://github.com/bluefireteam/audioplayers.git
      path: 'packages/audioplayers_linux'
      ref: 'gustl22/1486-ios-headphones'
  audioplayers_android:
    git:
      url: https://github.com/bluefireteam/audioplayers.git
      path: 'packages/audioplayers_android'
      ref: 'gustl22/1486-ios-headphones'
  audioplayers_darwin:
    git:
      url: https://github.com/bluefireteam/audioplayers.git
      path: 'packages/audioplayers_darwin'
      ref: 'gustl22/1486-ios-headphones'
  audioplayers_windows:
    git:
      url: https://github.com/bluefireteam/audioplayers.git
      path: 'packages/audioplayers_windows'
      ref: 'gustl22/1486-ios-headphones'

@Gustl22 Gustl22 requested review from spydon and luanpotter July 4, 2023 22:01
Copy link
Member

@spydon spydon left a 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 😅

@Gustl22
Copy link
Collaborator Author

Gustl22 commented Jul 6, 2023

@luanpotter do you have concerns about the changes?

@spydon
Copy link
Member

spydon commented Jul 6, 2023

@luanpotter do you have concerns about the changes?

I'll physically poke him, we're both at FlutterCon 😄

@Gustl22
Copy link
Collaborator Author

Gustl22 commented Jul 6, 2023

Nice to hear, enjoy your stay 🥳

@spydon
Copy link
Member

spydon commented Jul 6, 2023

Nice to hear, enjoy your stay 🥳

IMG_20230706_195620084.jpg

Luan thinks it looks good, he gives his physical approval! 😄

@Gustl22 Gustl22 merged commit 381c43e into main Jul 6, 2023
@Gustl22 Gustl22 deleted the gustl22/1486-ios-headphones branch July 6, 2023 18:58
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.

iOS crash when setting duck Sound does not play through headphones on Android and iOS devices
2 participants