I am leveraging the passive mute and unmute to moderate participant use of the audio functionality in my app. But when I call the mediaStream.muteAudio(userId) as a host when the participant is already muted the event is not fired.
Which Web Video SDK version?
Zoom Video SDK for Web version 1.9.8
To Reproduce(If applicable)
Steps to reproduce the behavior:
- Join meeting as host and then as participant.
- Mute audio as participant
- Call the mediaStream.muteAudio(userId) where userId is the participant’s user id as the host.
Thanks for your feedback.
Are you referring to the
current-audio-change event not firing on the participant side when the participant is already muted?
That’s by design. If the participant is already muted, there’s no action required on the host’s part.
Alternatively, could you provide more details about what you need to accomplish? I can offer some thoughts based on that information.
Yes I am referring to the current-audio-change event, but the case where the source is the
source === MutedSource.PassiveByMuteOne || source === MutedSource.PassiveByMuteAll.
I am using this for some form of moderation in my implementation.
But it happens that if the participant is already muted, then the event is not fired.
Yes, that’s correct.
When a participant is already muted, the host won’t take any further action. Are you looking to restrict participants from unmuting themselves?
Yes. I want to prevent the participants from un-muting themselves unless the host un-mutes them which allows them to unmute themselves and speak. I have already implemented this and it works well if the participant was unmuted before I call the mediaStream.muteAudio(userId). But if the participant was muted when the method was triggered, then nothing is fired and this is not what we want.
I need the event to be fired in order to execute some business logic to prevent the participant from unmuting until the host permits again for participants to speak.
Is this possible?
You can achieve this using the Command Channel feature in the Video SDK.
When the host needs to restrict participants from unmuting, the host sends a message to all participants, including future joiners, indicating the restriction on unmuting. You can choose a name for this message, for example, “restrict-unmute.”
On the participant’s side, if they receive the “restrict-unmute” message, they should restrict the user from calling the
stream.unmuteAudio method. Conversely, if the host wants to lift the restriction, they can broadcast a message like “allow-unmute.”
I hope this thought is helpful for you.
Okay, thanks. I will try this.
Thanks, the Command Channel worked for me.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.