diff --git a/.changes/fix-speaker-toggle b/.changes/fix-speaker-toggle new file mode 100644 index 000000000..8f977f662 --- /dev/null +++ b/.changes/fix-speaker-toggle @@ -0,0 +1 @@ +patch type="fixed" "Preserve Bluetooth and AirPlay options when forcing speaker output on iOS" diff --git a/lib/src/hardware/hardware.dart b/lib/src/hardware/hardware.dart index 505a4d3d8..065d4f361 100644 --- a/lib/src/hardware/hardware.dart +++ b/lib/src/hardware/hardware.dart @@ -152,6 +152,7 @@ class Hardware { if (_preferSpeakerOutput && _forceSpeakerOutput) { config = config.copyWith( appleAudioCategoryOptions: { + ...?config.appleAudioCategoryOptions, AppleAudioCategoryOption.defaultToSpeaker, }, ); diff --git a/lib/src/track/audio_management.dart b/lib/src/track/audio_management.dart index 95e0fa499..f287ca03b 100644 --- a/lib/src/track/audio_management.dart +++ b/lib/src/track/audio_management.dart @@ -116,6 +116,7 @@ Future _onAudioTrackCountDidChange() async { if (Hardware.instance.forceSpeakerOutput) { config = config.copyWith( appleAudioCategoryOptions: { + ...?config.appleAudioCategoryOptions, AppleAudioCategoryOption.defaultToSpeaker, }, );