Documentation
Interactive Live Streaming Standard (Legacy)
Console 官网 Community Technical support

What are the differences between setEnabled and setMuted?

Type: Integration issues    Platform: Web   Last Updated: 2022/09/14 23:17:03

The Web SDK 4.x and 3.x both provide APIs for controlling local audio and video capture and transmission. See the following table for the differences between these APIs:

API Capture Transmission Recovery time
(v3.x) Mute-related methods:
  • Stream.muteAudio
  • Stream.unmuteAudio
  • Stream.muteVideo
  • Stream.unmuteVideo
  • After muting the audio or video, the SDK does not stop audio or video capture. The camera light stays on. After muting the video, the SDK sends black video frames. After muting the audio, the SDK sends silent audio packets. Users whose streams are muted are counted as users sending streams. Agora limits the number of users sending streams concurrently in a channel to 17. Mute the audio or video and then unmute. It takes less time for the audio or video to resume.
    (v4.x) LocalTrack.setEnabled After calling setEnabled to disable a track, the SDK stops audio or video capture. The indicator light of the camera turns off and stays off. After calling setEnabled to disable a track, the SDK stops sending the audio or video stream. Users whose tracks are disabled are not counted as users sending streams. Disable an audio or video track and then re-enable it. It takes more time for the audio or video to resume.
    (v4.x) LocalTrack.setMuted After calling setMuted to mute a track, the SDK does not stop audio or video capture. The camera light stays on. After calling setMuted to mute an audio or video track, the SDK stops sending the audio or video stream. Users whose tracks are muted are not counted as users sending streams. Mute the audio or video and then unmute. It takes less time for the audio or video to resume.
    Do not call setEnabled and setMuted together.