In Lecture Mode, only the Moderator can publish a stream in the Room and the participants can only subscribe to the Moderator’s stream. If a participant(s) wants to publish their Stream during the session, they need to request the Moderator for Floor Access.
Table of Contents
- Request Floor Access
- Cancel Requested Floor Access
- Deny Floor Access
- Grant Floor Access
- Finish Granted Floor Access
- Release granted Floor Access
- Invite Participant to Floor
The Floor Access Controls are implemented using the following APIs:
Request Floor Access
The EnxRoom.requestFloor()
method allows a Participant to request the Moderator for Floor Access.
Method: EnxRoom.requestFloor(Callback)
Notification Event:
floor-requested
– Notification to the Moderator when a Participant’s access request is received.
room.requestFloor(function (arg) { if(arg.result == 1701) { /* Success */ } else { /* Error - Print arg.msg */ } }); // Moderator receives Floor Access Request room.addEventListener("floor-requested", function (evt) { /* evt.users.clientId, evt.users.name */ });
Error Codes / Exception
Code | Description |
---|---|
4101 | Unauthorized Access. When a user with moderator role invokes requestFloor() . |
1702 | Repeated Floor Request while a previous floor request is pending at the moderator end. |
Cancel Requested Floor Access
The Enxroom.cancelFloor()
method allows participants to cancel their request for Floor Access pending for Moderator’s approval.
Method: EnxRoom.cancelFloor(Callback)
Parameter:
Callback
– To know status of Cancelation request.
Event Notifications:
floor-cancelled
– Notification to the Moderator when the participant cancels the Floor Access Request.
room.cancelFloor(function (arg) { if(arg.result == 0) { // Floor Reqeust is cancelled } }); // Moderator receives Floor Cancellattion Notification room.addEventListener("floor-cancelled", function (evt) { // evt.msg.clientId = The participant who cancelled });
Error Codes / Exceptions
Code | Description |
---|---|
4101 | Unauthorized Access. When a user with moderator role invokes cancelFloor() . |
1707 | Invalid Request. When participant tries cancelFloor() without requesting Floor Access. |
Deny Floor Access
The EnxRoom.denyFloor()
method allows the Moderator to deny a Participant’s request for Floor Access.
Method: EnxRoom.denyFloor(ClientID, Callback)
Notification Event:
floor-denied
– Notification to the denied Participant and Moderator along with the responsible Moderator’s ID when the Floor Access is denied.
room.denyFloor(clientId, function (arg) { if (arg) { /* Success */ } else { /* Error - Print arg.msg */ } }); // Affected Participant and Moderator(s) are notified about denied request room.addEventListener("floor-denied", function (evt) { // evt.msg.moderatorId = The modeator who denied // evt.msg.clientId = The Participan who is denied });
Error Codes / Exceptions
Code | Description |
---|---|
4101 | Unauthorized Access. When a participant invokes denyFloor() . |
1711 | When denyFloor() is called with an invalid Client ID. |
Grant Floor Access
The EnxRoom.grantFloor()
method allows the Moderator to grant Floor Access to one or more Participants one by one. Note that at any given point in time, only one Participant can be granted floor access. To grant Floor Access to others, the Moderator must release Floor Access from the existing participant.
Method: EnxRoom.grantFloor(clientID, Callback)
Parameters:
clientID
– Client-ID of the Participant who is granted Floor Access.Callback
– To know the status of Floor Access request.
Notification Event:
floor-granted
– Notification to the Participant when Floor Access is received and notification to all the Moderator(s) with Moderator ID of the Moderator who granted Floor Access.
room.grantFloor(clientId, function (arg) { if (arg) { /* Success */ } else { /* Error - Print arg.msg */ } }); // Moderators and the Participant is notified about granted Floor Access room.addEventListener("floor-granted", function (evt) { // room.publish(localStream); // Publish stream // evt.msg.moderatorId = Moderator who granted Floor Access });
Error Codes / Exceptions
Code | Description |
---|---|
4101 | Unauthorized Access. When a participant uses grantFloor() . |
1711 | When grantFloor() is called with Invalid Client ID. |
1703 | Repeated grantFloor() method call after granting Floor Access to participant. |
1173 | Failed to grant Floor Access to the Participant. |
1131 | Participant cannot publish Stream without Floor Access. |
1710 | Floor Access Requests / Floor Grants have exceeded the permissible limit. |
Finish Granted Floor Access
The EnxRoom.finishFloor()
allows the Participant to announce the completion of Floor Access and release Floor Access.
Method: EnxRoom.finishFloor(Callback)
Callback: To know the status of Floor Access request.
Event Notification:
floor-finished:
Notification to all the Moderator(s) when the Participant finishes Floor Access.
room.finishFloor(function (arg) { if(arg.result == 0) { // Floor Access is finished } }); // Moderators receive notification room.addEventListener("floor-finished", function (evt) { // evt.msg.clientId = The participant who finished floor access });
Release Floor Access
The Enxroom.releaseFloor()
method allows the Moderator to terminate the Floor Access granted to a Participant. This unpublishes the participant’s streams and makes the Floor available for access again.
Method: EnxRoom.releaseFloor(ClientID, Callback)
Parameters:
ClientID
– Client ID of the Participant whose Floor Access is being released.Callback
– To know the status of Floor Release call.
Notification Event:
release-floor
– Notification to the affected Participant and Moderator(s) when Floor Access is released along with the responsible Moderator ID.
room.relaseFloor(clientId, function (arg) { if (arg) { /* Success */ } else { /* Error - Print arg.msg */ } }); // Notification when floor access is released room.addEventListener("release-floor", function (evt) { // evt.msg.moderatorId = The moderator who released floor access // evt.msg.clientId = The Participant whose floor access is released });
Invite to Floor
In lecture mode, where only the Moderator can speak and control speakers in the Room through Floor Access Control methods, the Invite to Floor methods provide more options to the Moderator to organize a conference in lecture mode.
Invite Participant to Floor
The EnxRoom.inviteToFloor()
method allows the Moderator to invite any Participant in the ongoing conference to the Floor and talk.
Method: EnxRoom.inviteToFloor(clientId, callack)
Parameter:
clientId
– String. The client ID of the invited Participant.callback
: To know status of the method call.
Event Notification:
floor-invited
– Notification to all the Moderators in the Room and the invited Participant when the Participant is invited to join the Floor
// Invite a Participant to join Floor room.inviteToFloor (clientId, function (resp) { if (resp.result == 0) { // Success } }); // Notification to Moderators and invited Participant room.addEventListener("floor-invited", function (evt) { // evt is JSON, e.g. /* { "type": "floor-invited", "users": { "id": "inviteToFloor", "clientId": "STRING", "name": "String", "moderator": "STRING" } } */ });
Error Codes & Exceptions:
Code | Description |
---|---|
5086 | Endpoint application is not connected to a Room. |
5097 | inviteToFloor () is not applicable in a Chat-Only Room. Non-Contextual method call. |
5006 | A User with a participant role is not authorized to invoke inviteToFloor (). |
5045 | Unable to invite a user with an invalid client ID. |
Cancel Invitation to Floor
The EnxRoom.cancelFloorInvite()
method allows the Moderator to cancel a Floor Invitation sent to a Participant.
Method: EnxRoom.cancelFloorInvite(clientId, Callback)
Parameter:
clientId
– Client Id of the Participant whose invitation needs to be canceled.Callback
-To know status of the method call
Event Notification:
floor-invite-cancelled
– Notification to the invited Participant and other Moderators in the Room when invitation is canceled by a Moderator.
// Cancel Invitation to Floor for a Participant room.cancelFloorInvite(clientId, function (resp) { if (resp.result == 0) { // Success } }); // Notification to Moderators and invited Participant room.addEventListener("floor-invite-cancelled", function (evt) { // evt is JSON, e.g. /* { "type": "floor-invite-cancelled", "users": { "id": "cancelFloorInvite", "clientId": "STRING", "name": "String", "moderatorId": "STRING" } } */ });
Error Codes & Exceptions:
Code | Description |
---|---|
5086 | Endpoint application is not connected to a Room. |
5097 | cancelFloorInvite () not applicable in a Chat-Only Room. Non-Contextual method call. |
5006 | A User with a participant role is not authorized to invoke cancelFloorInvite (). |
5045 | Unable to cancel the invitation for an invalid client ID. |
Accept Invitation to Floor
The EnxRoom.acceptInviteFloorRequest()
method allows the Participant to accept the invitation to the Floor and talk.
Method: EnxRoom.acceptInviteFloorRequest (String clientId)
Parameter:
Callback
– To know status of the method call
Event Notification:
floor-accepted
– Notification to all the Moderator(s) in the Room when the Participant accepts invitation.
// Invited Participant to accept Invitation to join Floor room.acceptInviteFloorRequest (function (resp) { if (resp.result == 0) { // Success } }); // Notification to Moderators room.addEventListener("floor-accepted", function (evt) { // evt is JSON, e.g. /* { "type": "floor-accepted", "users": { "id": "floorAccepted", "clientId": "STRING", "result": 1739, "msg": "Floor accepted" } } */ });
Error Codes & Exception:
Code | Description |
---|---|
5086 | Endpoint application is not connected to a Room. |
5097 | () not applicable in a Chat-Only Room. Non-Contextual method call. |
5006 | A User with a Moderator role is not authorized to invoke (). |
5045 | Unable to accept the invitation for an invalid client ID. |
Reject Invitation to Floor
The EnxRoom.rejectInviteFloor()
method allows the invited Participant to reject the invitation to the Floor.
Class: EnxRoom
Method: EnxRoom.rejectInviteFloor(Callback)
Parameter:
Callback
– To know status of the reject invitation call.
Event Notification:
floor-rejected
– Notification to all the Moderators including the one who sent the invitation when the Participant rejects the invitation to join the floor.
// Invited Participant to reject Invitation to join Floor room.rejectInviteFloor (function (resp) { if (resp.result == 0) { // Success } }); // Notification to Moderators room.addEventListener("floor-rejected", function (evt) { // evt is JSON, e.g. /* { "type": "floor-rejected", "users": { "id": "floorRejected", "clientId": "STRING", "result": 1709, "msg": "Floor rejected" } } */ });
Error Codes & Exceptions:
Code | Description |
---|---|
5086 | Endpoint application is not connected to a Room. |
5097 | () not applicable in a Chat-Only Room. Non-Contextual method call. |
5006 | A User with a Moderator role is not authorized to invoke (). |
5045 | Unable to reject the invitation for an invalid client ID. |
Restore Moderator Session
If the Moderator gets disconnected during a session, the list of Floor Access Requests and participants currently with Floor Access can be retrieved via the Room-Meta-Data when the Moderator gets reconnected.
Structured Data JSON
room.raisedHands
– An Array of Client IDs requesting floor access.room.approvedHands
– An Array of Client IDs currently having floor access.