100ms Logo

100ms

Docs

Search docs
/

Mute & Umute

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.

It can be called on local (you) peers' audio or video tracks.

You get a reference to your own local peer from localPeer on HMSSDK instance.

// instance acquired from build() method hmsInstance.localPeer.localAudioTrack().setMute(true); // audio track hmsInstance.localPeer.localVideoTrack().setMute(true); // video track

Mute/Unmute Status

Mute/Unmute can be done for local peer as well as remote peer according to their mute status.

In most of the cases you would need to render the components on basis of current mute status of peers like their mic and camera icons.

isAudioMute: boolean = peer?.audioTrack?.isMute(), isVideoMute: boolean = peer?.videoTrack?.isMute(),

For muting remote peer refer to Change Track State docs and for muting remote peers locally refer to Playback Allowed docs.