setSpeakerOn method
speakerOn set speakerphone on or off, by default wired/bluetooth headsets will still
be prioritized even if set to true.
forceSpeakerOutput if true, will force speaker output even if headphones
or bluetooth is connected, only supported on iOS for now
Implementation
Future<void> setSpeakerOn(bool speakerOn, {bool forceSpeakerOutput = false}) async {
if (lkPlatformIsMobile()) {
await Hardware.instance.setSpeakerphoneOn(speakerOn, forceSpeakerOutput: forceSpeakerOutput);
engine.roomOptions = engine.roomOptions.copyWith(
defaultAudioOutputOptions: roomOptions.defaultAudioOutputOptions.copyWith(
speakerOn: speakerOn,
),
);
}
}