ModeratorControls

ModeratorControls

new ModeratorControls()

Constructor for ModeratorControls.
Includes API calls for Admin controls in a given session. Where Admin can Kick Participants, lock and unlock room, grant moderator priveleges to other participants in room.

Example
//This is available as an object from session. 
Note :: Admin object will be null for non-admin particpants
irisRtcSession.admin

Methods

grantAllModeratorPrivilege(roomId, moderatorRights)

This API is called to give moderator privilege to other participants. Only a Moderator with affiliation as owner can call this API

Example
// Should use 'admin' object from irisRtcSession to call this API
irisRtcSession.admin.grantAllModeratorPrivilege(roomId, moderatorRights);
Parameters:
Name Type Description
roomId string

(MANDATORY) Room Id

moderatorRights json

(MANDATORY) Moderator rights to be given to others

Properties
Name Type Description
screenShare boolean

(MANDATORY) true if admin is granting moderator privilege.

grantModeratorPrivilege(roomId, participantJid, moderatorRights)

This API is called to give moderator privilege to other participants. Only a Moderator with affiliation as owner can call this API

Example
// Should use 'admin' object from irisRtcSession to call this API
irisRtcSession.admin.grantModeratorPrivilege(roomId, participantJid);
Parameters:
Name Type Description
roomId string

(MANDATORY) Room Id

participantJid string

(MANDATORY) Participant jid to whom moderator privilege is given

moderatorRights json

(MANDATORY) Moderator rights to be given to others

Properties
Name Type Description
screenShare boolean

(MANDATORY) true if admin is granting moderator privilege.

kickParticipant(roomId, participantJid)

This API is called when an occupant needs to be kicked out of the current session, Kicked out occupant won't be able to rejoin during the current session. Only a Admin is allowed to kick other participants out of the room and he can't kick himself

Example
// Should use 'admin' object from irisRtcSession to call this API, Only session Admin can call this API
irisRtcSession.admin.kickParticipant(roomId, participantJid);
Parameters:
Name Type Description
roomId string

(MANDATORY) Room Id

participantJid string

(MANDATORY) Jid of the participant to be kicked out of the room

lockRoom(roomId, rejoin)

This API is called to lock the room with exitsing number of participants in an ongoing sesison. Once room is locked no new participants are allowed to join the room.

During a session if any participant gets disconnected because of some reason, moderator can control whether or not disconnected participant to be allowed to join the room again by setting rejoin attribute to true/false while calling this API.

Only a Admin can lock the room.

Example
// Should use 'admin' object from irisRtcSession to call this API
irisRtcSession.admin.lockRoom(roomId, rejoin);
Parameters:
Name Type Description
roomId string

(MANDATORY) Room ID of the session to locked

rejoin boolean

(MANDATORY) true for allowing abruptly disconnected participants to rejoin a locked room.
false for restricting abruptly disconnected participants to rejoin a locked room.

revokeAllModeratorPrivilege(roomId, moderatorRights)

This API is called to revoke moderator privilege from other participants. Only a Admin with affiliation as owner can call this API

Example
// Should use 'admin' object from irisRtcSession to call this API
irisRtcSession.admin.revokeAllModeratorPrivilege(roomId, moderatorRights);
Parameters:
Name Type Description
roomId string

(MANDATORY) Room Id

moderatorRights json

(MANDATORY) Moderator rights to be revoked to others

Properties
Name Type Description
screenShare boolean

(MANDATORY) false if admin is revoking moderator privilege.

revokeModeratorPrivilege(roomId, participantJid, moderatorRights)

This API is called to revoke moderator privilege from other participants. Only a Admin with affiliation as owner can call this API

Example
// Should use 'admin' object from irisRtcSession to call this API
irisRtcSession.admin.revokeModeratorPrivilege(roomId, participantJid);
Parameters:
Name Type Description
roomId string

(MANDATORY) Room Id

participantJid string

(MANDATORY) Jid of participant whose moderator privilege is being revoked

moderatorRights json

(MANDATORY) Moderator rights to be revoked to others

Properties
Name Type Description
screenShare boolean

(MANDATORY) false if admin is revoking moderator privilege.

unlockRoom(roomId)

This API is called to unlock the already locked room, Once room is unlocked new participants can join the room. Only Admin can unlock the room

Example
// Should use 'admin' object from irisRtcSession to call this API
irisRtcSession.admin.unlockRoom(roomId);
Parameters:
Name Type Description
roomId string

(MANDATORY) Room Id of the session to be unlocked