Floor Access Control
In the Lecture Mode, only the moderator can publish a stream in a room, and the participants can only subscribe to the moderator's stream. If participants want to publish their streams during a session, they must request the moderator for floor access to do this.
The React Native SDK provides the following methods for managing floor access:
- requestFloor(): To request the moderator for floor access.
- cancelFloor(): To cancel a floor access request.
- grantFloor(): To grant floor access to one or more participants in sequence.
- denyFloor(): To deny a participant's request for floor access.
- finishFloor(): To announce the completion of floor access and its availability for subsequent requests.
- releaseFloor(): To terminate the floor access granted to a participant.
- inviteToFloor(): To invite a participant of an ongoing conference to the floor.
Request Floor Access
The Enx.requestFloor()
method allows a participant to request the moderator for floor access.
Method: Enx.requestFloor()
Callbacks
Callback | Description |
---|---|
floorRequested | Requesting Participant received acknowledgment that Moderator had received his request. |
floorRequestReceived | The Moderator receives requests from Participant. |
Sample Code
Enx.requestFloor(); // Participant requests floor access// Participant is acknowledgedfloorRequested : event =>{// event { result:1701, msg:'Floor Request Received' }}// Moderator receive Floor Access RequestfloorRequestReceived : event =>{// event { clientId : 1234, name : 'android' }}
Cancel a Requested Floor Access
The Enx.cancelFloor()
method allows participants to cancel their floor access requests pending moderator approval.
Method: Enx.cancelFloor()
Callbacks
Callback | Description |
---|---|
cancelledFloorRequest | Notification to the Moderator when the participant cancels the Floor Access Request. |
floorCancelled | Acknowledgment to the Participant when their Floor Access Request is canceled. |
Sample Code
Enx.cancelFloor()cancelledFloorRequest:event=>{// Moderator receives cancelation request}floorCancelled:event=>{// Participant is acknowledged that floor request is canceled}
Error Codes and Exceptions
Code | Description |
---|---|
5003 | Unauthorized Access. When a user with a moderator role invokes cancelFloor(). |
5041 | Repeated cancelFloor() call while a previous request is in process. |
5042 | Repeated cancelFloor() call after the request has already been canceled. |
5067 | Unable to process the request for a Room in group mode. Non-Contextual method call. |
Grant Floor Access
The Enx.grantFloor(clientID)
method allows the moderator to grant floor access to one or more participants individually. Note that at any given time, only one participant can be granted floor access. To grant floor access to other participants, the moderator must release floor access from the existing participant.
Method: Enx.grantFloor(clientID)
Parameter: clientID
: String. Client ID to whom the Moderator grant floor access.
Callbacks
Callback | Description |
---|---|
processFloorRequested | The moderator acknowledged that Participant was granted floor access. |
grantedFloorRequest | The Participant receives floor access. |
Sample Code
Enx.grantFloor(ClientId); // To grant floor access to ClientId// To participant: Floor Access grantedgrantedFloorRequest : event =>{// event = { result:1708, msg:'Floor Granted', clientId: "XXX" }}//To moderator: AcknowledgementprocessFloorRequested : event =>{// event = { result:1708, msg:'Floor Granted' }}
Deny Floor Access
The Enx.denyFloor(ClientId)
method allows a moderator to deny a participant's request for floor access.
Method: Enx.denyFloor(ClientId)
Parameter: clientID
: String. Client ID to whom the Moderator deny floor access.
Callbacks
Callback | Description |
---|---|
processFloorRequested | The moderator acknowledged that he denied floor access to a participant. |
deniedFloorRequest | The participant is notified that he has been denied floor access. |
Sample Code
Enx.denyFloor(ClientId); // To deny floor access to ClientId// To participant: Floor Access request denieddeniedFloorRequest : event =>{// event = { result:4117, msg:'Floor request denied', clientId: "XXX" }}//To moderator: AcknowledgementprocessFloorRequested : event =>{// event = { result:1709, msg:'Floor Denied' }}
Finish Floor Access
The Enx.finishFloor()
method allows participants to announce the completion of floor access and availability of floor for subsequent requests.
Method: Enx.finishFloor()
Callbacks
Callback Name | Description |
---|---|
finishedFloorRequest | Notification to the Moderator when the Participant finishes Floor Access |
floorFinished | Acknowledgment to the Participant when Floor Access is finished |
Sample Code
Enx.finishFloor()onFinishedFloorRequest:event=>{// Moderator received Floor Finish notification}onFloorFinished:event=>{// Participants is acknowledged that floor access is finished}
Error Codes and Exceptions
Code | Description |
---|---|
5003 | Unauthorized Access. When a user with a moderator role invokes finishFloor() . |
5041 | Repeated finishFloor() call while the previous request is in process. |
5042 | When the participant retries finishFloor() after finishing the Floor Access. |
5067 | Unable to process the request for a Room in group mode. Non-Contextual method call. |
Note: In case of an error, <null>
is received at the first Index and Error Info at the second Index.
Release Floor Access
The Enx.releaseFloor(clientId)
method allows moderators to terminate the floor access granted to a participant. It unpublishes the participant's streams and makes the floor available for access.
Method: Enx.releaseFloor(clientId)
Parameter: clientID
: String. Client ID to whom the Moderator release floor access.
Callbacks
Callback | Description |
---|---|
processFloorRequested | The moderator acknowledged that the floor is released |
floorReleased | The participant was notified that floor access had been revoked. His stream is automatically unpublished |
Sample Code
Enx.releaseFloor(ClientId); // To release floor access floor ClientId// To participant: Floor Access releasedfloorReleased : event =>{// event = { result:1712, msg:'Floor released', clientId: "XXX" }}//To moderator: AcknowledgementprocessFloorRequested : event =>{// event = { result:1712, msg:'Floor Released' }}
Restore Moderator Session
If the moderator is disconnected during a session, the list of floor access requests and participants currently with the floor access can be retrieved through the room meta data when the moderator is reconnected.
Structured Data JSON:
room.raisedHands
: An Array of Client-IDs who requested floor access.room.approvedHands
: An Array of Client-IDs who currently have floor access.
Invite to Floor
In the Lecture mode, where only a moderator can speak and control speakers in the room through the Floor Access Control methods, the Invite to Floor methods provide more options to the moderator to organize a conference in this mode.
The Enx.inviteToFloor()
method allows the Moderator to invite any participant in the ongoing conference to the Floor and talk.
Method: Enx.inviteToFloor(clientId)
Parameter: clientID
: String. Client ID of the participant whom the moderator invites to the floor.
Callbacks
Callback | Description |
---|---|
ackInviteToFloorRequested | Acknowledgment to the Moderator when an invitation to Floor is sent to the participant. |
inviteToFloorRequested | Notification to all the moderators in the room when an invitation to Floor is sent to the participant. |
Sample Code
Enx.inviteToFloor(clientId)ackInviteToFloorRequested:event=>{//Acknowledgment to the moderator who invited}inviteToFloorRequested:event=>{//Notification to all the moderators in the room}invitedForFloorAccess: event=>{//Notification to the invited participant}
Error Codes and Exceptions
Code | Description |
---|---|
5086 | The 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. |
5067 | Unable to process the request for a Room in group mode. Non-Contextual method call. |