setMicrophoneMuted method

Future<bool> setMicrophoneMuted(
  1. bool muted
)

Implementation

Future<bool> setMicrophoneMuted(bool muted) async {
  if (!await hasAudioDevice()) {
    return false;
  }

  if (localUserMediaStream != null) {
    localUserMediaStream!.setAudioMuted(muted);
    setTracksEnabled(localUserMediaStream!.stream!.getAudioTracks(), !muted);
  }

  for (final call in calls) {
    await call.setMicrophoneMuted(muted);
  }

  onGroupCallEvent.add(GroupCallEvent.LocalMuteStateChanged);
  return true;
}