Skip to content

fix!: Default audio output to system preferences#1563

Merged
Gustl22 merged 10 commits into
mainfrom
gustl22/1486-ios-headphones
Jul 6, 2023
Merged

fix!: Default audio output to system preferences#1563
Gustl22 merged 10 commits into
mainfrom
gustl22/1486-ios-headphones

Conversation

@Gustl22

@Gustl22 Gustl22 commented Jul 4, 2023

Copy link
Copy Markdown
Collaborator

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

Gustl22 commented Jul 4, 2023

Copy link
Copy Markdown
Collaborator Author

@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 luanpotter and spydon July 4, 2023 22:01

@spydon spydon left a comment

Copy link
Copy Markdown
Member

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

Gustl22 commented Jul 6, 2023

Copy link
Copy Markdown
Collaborator Author

@luanpotter do you have concerns about the changes?

@spydon

spydon commented Jul 6, 2023

Copy link
Copy Markdown
Member

@luanpotter do you have concerns about the changes?

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

@Gustl22

Gustl22 commented Jul 6, 2023

Copy link
Copy Markdown
Collaborator Author

Nice to hear, enjoy your stay 🥳

@spydon

spydon commented Jul 6, 2023

Copy link
Copy Markdown
Member

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