The EnxRoom.switchUserRole() method allows the Moderator to promote a Participant to act as a Moderator in the ongoing Session. This newly appointed Moderator gets access to Moderator Controls and the former Moderator becomes a Participant in the Session. The new Moderator can further grant the Moderator role to another participant if so desired.

Method: EnxRoom.switchUserRole(ParticipantId, Callback)

Parameters: ParticipantID – Client ID of the participant who is being designated as Moderator

Notification Event:

  • user-role-changed – Notification to all participants in the Room when a participant is newly appointed as the Moderator. The appointed moderator is notified with extra information required to moderate the Session.
room.switchUserRole (participantId, function(status) { 
     if ( status.result == 0) {
         // Succeeded
     else {
         // Failed message: status.msg
 room.addEventListener('user-role-changed', function (evt) {
      // evt JSON Structure
      {		raisedHands: [], //Raised Hand Requests
		approvedHands: [],  // Who has floor control
		moderator: {
			new : new client_id, // New Moderartor
			old : old clientId   // Old Moderartor