Table of Contents

Hard Mute / Unmute Room

The EnxRoom.hardMute() method allows the Moderator to hard-mute the Room where all the participants are muted. A new participant joining a Room in a hard-mute state would also be muted by default. The right to unmute a hard-mute Room lies only with the Moderator and participants cannot unmute their Local Streams either. The EnxRoom.hardUnMute() method is used to put the Room off a hard-mute state.

Class: EnxRoom

Methods:

  • EnxRoom.hardMute(Callback)
  • EnxRoom.hardUnmute(Callback)

Event Notifications:

  • hard-mute-room – Notification to all the participants in the Room along with Moderator ID when Room is hard-muted.
  • hard-unmute-room – Notification to all the participants in the Room along with Moderator ID when Room is put off hard- mute state.
// Moderator hard-mutes room
room.hardMute(function (result, error) {
 /* result JSON
 { "result": 0,
 "msg": "Room is muted"
 }
 */
});

// Moderator hard-unmutes room
room.hardUnmute(function (result, error) {
 /*Result JSON
 { "result": 0,
 "msg": "Room is un-muted"
 }
 */
});

// Partipants are notifed on room being hard-muted
room.addEventListener("hard-mute-room", function (res) {
   // res.moderator = Moderator who hard-muted Room. 
});

// Partipants are notifed on room being hard-unmuted
room.addEventListener("hard-unmute-room", function (res) {
 // res.moderator = Moderator who hard-unmuted Room.  
});

Hard Mute / Unmute Participant

The EnxRoom.hardMuteUserAudio() and  EnxRoom .hardMuteUserVideo() methods allow the Moderator to hard-mute a Participant’s Audio and Video Streams respectively. The affected Participant cannot unmute their Audio or Video Streams. The Moderator can unmute the Participant’s Audio or Video Streams using  EnxRoom .hardUnMuteUserAudio() and  EnxRoom .hardUnMuteUserVideo() methods respectively.

Class: EnxRoom

Methods:

  • EnxRoom.hardMuteUserAudio(clientId, Callback)
  • EnxRoom.hardMuteUserVideo(clientId, Callback)
  • EnxRoom.hardUnmuteUserAudio(clientId, Callback)
  • EnxRoom.hardUnmuteUserVideo(clientId, Callback)

Parameters:

clientId – The user whose audio/video needs to be hard muted/unmuted.

Event Notifications:

  • hardmute-user-audio – Notification to the affected participant when their Audio is hard-muted.
  • hardunmute-user-audio – Notification to the affected participant when their Audio is lifted off the hard-mute state.
  • hardmute-user-video – Notification to the affected participant when their Video is hard-muted.
  • hardunmute-user-video – Notification to the affected participant when their Video is lifted off the hard-mute state.
  • user-audio-muted – Notification to all the participants in the Room when a user’s Audio is hard-muted.
  • user-audio-unmuted – Notification to all the participants in the Room when a user’s Audio is lifted off the hard-mute state.
  • user-video-muted – Notification to all the participants in the Room when a user’s Video is hard-muted.
  • user-video-unmuted – Notification to all the participants in the Room when a user’s Video is lifted off the hard-mute state.

All the events message carry Moderator ID who hard-muted or hard-unmuted Audio/Video of a Participant.

// Hard mute User's audio     
room.hardMuteUserAudio(clientId, function(response) {
     if (response.result === 0) {
         // Success
     }
     else {      
         // Failed
     }
});

// Hard mute User's video*/    
room.hardMuteUserVideo (clientId, function(response) {
     if (response.result === 0) {
         // Success
     }
     else {      
         // Failed
     }
});

room.addEventListener('hardmute-user-audio', function(event) { 
     // Your audio is hard muted
     // event.moderator = Moderator who hard-muted user's Audio.
});

room.addEventListener('hardmute-user-video', function(event) {
      // Your video is hard muted 
});

room.addEventListener('user-audio-muted', function(event) {      
      // User's audio muted     
      // Info about user event.stream.attributes
}); 

room.addEventListener('user-video-muted', function(event) {      
      // User's video muted     
      // Info about user event.stream.attributes
});

// Similarly you may code for hard unmute User's audio/video  
// using related methods and event notifications