Table of Contents
Lock / Unlock Room
The Enx.lockRoom()
method allows the Moderator to lock the Room which forbids any new user from joining the Session. The Moderator can unlock the Room using Enx.unLockRoom()
method to allow subsequent users to join the Session.
Class: Enx
Methods:
Enx.lockRoom()
– No Parameter required.Enx.unLockRoom()
– No Parameter required.
Callbacks:
ackLockRoom
-
Acknowledgment to the Moderator when the Room is locked.lockedRoom
-
Notification to all the participants in the Room when the room is locked.ackUnLockRoom
-
Acknowledgment to the Moderator when the Room is unlocked.unLockedRoom
-
Notification to all the participants in the Room when the room is unlocked.
Enx.lockRoom(). //Lock room
Enx.unLockRoom(). //Unlock room
ackLockRoom:event=>{
// Moderator is acknowledged that room has been locked
}
lockedRoom:event=>{
// Participants are notified that room has been locked
}
ackUnLockRoom:event=>{
// Moderator is acknowledged that room has been unlocked
}
unLockedRoom:event=>{
// Participants are notified that room has been unlocked
}
Error Codes & Exceptions
Code | Description |
---|---|
5115 | Unauthorized Access. When a user with participant role invokes lockRoom() or unlockRoom() . |
5117 | Invalid request. When the Moderator invokes lockRoom() on a locked Room. |
5118 | Invalid request. When the Moderator invokes un on an unlocked Room. |
Moderate Participants’ entry to a Session
In a knock-enabled Room, a user needs to wait until the Moderator grants them permission to join the Session. The Enx.approveAwaitedUser()
method allows the Moderator to approve a user’s entry and Enx.denyAwaitedUser()
method is used to decline a user’s entry to the Session.
Methods:
Enx.approveAwaitedUser(clientId)
Enx.denyAwaitedUser(clientId)
Parameters:
clientId
: Client ID of the user awaiting the Moderator’s approval.
Callbacks:
userAwaited
– Notification to the Moderator when a user awaits their permission to join Room.roomAwaited
– Notification to the user when they await Moderator’s permission to join Room with { “event_type”: “knock” } in the JSON Payload.ackForApproveAwaitedUser
– Acknowledgment to the Moderator when the user is granted permission to join Room.roomConnected
– Notification to the user when the user is permitted to join Room.ackForDenyAwaitedUser
– Acknowledgment to the Moderator when the user is denied permission to join Room.roomDisconnected
– Notification to the user along with a reason for denial when the user is denied access to the Room.
Enx.approveAwaitedUser(clientId)
Enx.denyAwaitedUser(clientId)
userAwaited:event=>{
// Moderator is notified about awaited user
}
roomAwaited:event=>{
// Notification to the user when they await Moderator’s permission to join Room
}
ackForApproveAwaitedUser:event=>{
// User has been allowed entry
}
ackForDenyAwaitedUser:event=>{
// User has been denied entry
}