toggleAudioInput method
Future<void>
toggleAudioInput(
{ - bool? forceValue,
})
override
Implementation
@override
Future<void> toggleAudioInput({bool? forceValue}) async {
if (_mParticipant == null) return;
final tracks = _localCameraStream?.getAudioTracks() ?? [];
final newValue = forceValue ?? !_mParticipant!.isAudioEnabled;
for (final track in tracks) {
track.enabled = newValue;
}
_mParticipant = _mParticipant?.copyWith(isAudioEnabled: newValue);
_notify(CallbackEvents.shouldBeUpdateState);
if (_currentRoomId != null) {
_wsEmitter.toggleAudio(newValue);
}
}