mute method

Future<bool> mute({
  1. bool stopOnMute = true,
})

Mutes this LocalTrack. This will stop the sending of track data and notify the RemoteParticipant with TrackMutedEvent. Returns true if muted, false if unchanged.

Implementation

Future<bool> mute({bool stopOnMute = true}) async {
  logger.fine('LocalTrack.mute() muted: $muted');
  if (muted) return false; // already muted
  await disable();
  if (!skipStopForTrackMute() && stopOnMute) {
    await stop();
  }
  updateMuted(true, shouldSendSignal: true);
  return true;
}