Mute / Unmute

Mute is something that applies to both audio and video. When you mute audio, you can't be heard by other people. When you mute video, you will not be broadcasting your video to other people.

await hmsActions.setLocalVideoEnabled(false); await hmsActions.setLocalAudioEnabled(true);

Toggling current mute state

  1. Get current state
  2. Invert the state and set as new value
async function toggleAudio() { const enabled = hmsStore.getState(selectIsLocalAudioEnabled); await hmsActions.setLocalAudioEnabled(!enabled); } async function toggleVideo() { const enabled = hmsStore.getState(selectIsLocalVideoEnabled); await hmsActions.setLocalVideoEnabled(!enabled); }