Skip to content

Commit cb16c12

Browse files
authored
fix!: Change the default value of iOS audio context to force speakers (#1363)
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. 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.
1 parent 6a66d42 commit cb16c12

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/audioplayers_platform_interface/lib/api/audio_context_config.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class AudioContextConfig {
7272
final bool stayAwake;
7373

7474
AudioContextConfig({
75-
this.forceSpeaker = false,
75+
this.forceSpeaker = true,
7676
this.duckAudio = false,
7777
this.respectSilence = false,
7878
this.stayAwake = true,

0 commit comments

Comments
 (0)