Skip to main content

You are viewing Agora Docs forBetaproducts and features. Switch to Docs

What are the differences between setEnabled and setMuted?

Both Web SDK 4.x and 3.x provide APIs for controlling the collection and sending of local audio and video. The differences between these APIs are detailed in the table below. You cannot call setEnabled and setMuted at the same time.

APICaptureSendRecovery time
(3.x) Mute-related methods: Stream.muteAudio Stream.unmuteAudio Stream.muteVideo Stream.unmuteVideoAfter muting, the SDK does not stop audio and video capture. The camera's light does not turn off.The SDK sends a black frame after muting video and a mute packet after muting audio. Muted users are counted as streaming users, and up to 17 users can stream at the same time in a single channel.Unmuting after a mute is relatively faster.
(4.x)LocalTrack.setEnabledAfter calling setEnabled to disable the track, the SDK stops audio and video capture. The camera's light turns off.The SDK does not send any data after calling setEnabled to disable the track. Users whose tracks are disabled are not counted as streaming users.Enabling audio and video after disabling it is relatively slower.
(4.x)LocalTrack.setMutedAfter calling setMuted to mute the track, the SDK does not stop audio and video capture. The camera's light does not turn off.The SDK does not send any data after calling setMuted to mute the track. Muted users are not counted as streaming users.Unmuting after a mute is relatively faster.
vundefined