toggleSpeakerOutput method
Future<void>
toggleSpeakerOutput(
{ - bool? forceValue,
})
override
Implementation
@override
Future<void> toggleSpeakerOutput({bool? forceValue}) async {
if (_mParticipant == null) return;
final newValue = forceValue ?? !_mParticipant!.isSpeakerPhoneEnabled;
_mParticipant = _mParticipant?.copyWith(isSpeakerPhoneEnabled: newValue);
if (WebRTC.platformIsMobile) {
await Helper.setSpeakerphoneOn(newValue);
if (newValue) {
await Helper.setSpeakerphoneOnButPreferBluetooth();
}
}
_notify(CallbackEvents.shouldBeUpdateState);
}