Mute/unmute microphone or webcam programmatically

Hi!
How to mute/unmute microphone or webcam using Web SDK for anonymous participant programmatically? (Get current user returns undefined for anonymous participant).

Hey @pavel.lychkousky,

What do you mean anonymous participant?

Thanks,
Tommy

Without zoom account (or not logged in)

@tommy Do you need more clarifying?

Hey @pavel.lychkousky,

The user will still have an ID which you can get from the getCurrentUser function and then use to mute the user.

Thanks,
Tommy

@tommy thank you, I was able to mute microphone by this code
ZoomMtg.getCurrentUser({
success (response) {
ZoomMtg.mute({userId: response.result.currentUser.userId, mute: true});
}
});

But how can I mute video?

1 Like

Hey @pavel.lychkousky,

Happy to hear you are successfully able to mute a participant! :slight_smile:

Currently the Web SDK cannot turn on / off the video. A user has to do this themselves.

Thanks,
Tommy