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

CallbackDescription
floorRequestedRequesting Participant received acknowledgment that Moderator had received his request.
floorRequestReceivedThe Moderator receives requests from Participant.

Sample Code

Enx.requestFloor(); // Participant requests floor access
// Participant is acknowledged
floorRequested : event =>{
// event { result:1701, msg:'Floor Request Received' }
}
// Moderator receive Floor Access Request
floorRequestReceived : 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

CallbackDescription
cancelledFloorRequestNotification to the Moderator when the participant cancels the Floor Access Request.
floorCancelledAcknowledgment 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

CodeDescription
5003Unauthorized Access. When a user with a moderator role invokes cancelFloor().
5041Repeated cancelFloor() call while a previous request is in process.
5042Repeated cancelFloor() call after the request has already been canceled.
5067Unable 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

CallbackDescription
processFloorRequestedThe moderator acknowledged that Participant was granted floor access.
grantedFloorRequestThe Participant receives floor access.

Sample Code

Enx.grantFloor(ClientId); // To grant floor access to ClientId
// To participant: Floor Access granted
grantedFloorRequest : event =>{
// event = { result:1708, msg:'Floor Granted', clientId: "XXX" }
}
//To moderator: Acknowledgement
processFloorRequested : 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

CallbackDescription
processFloorRequestedThe moderator acknowledged that he denied floor access to a participant.
deniedFloorRequestThe 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 denied
deniedFloorRequest : event =>{
// event = { result:4117, msg:'Floor request denied', clientId: "XXX" }
}
//To moderator: Acknowledgement
processFloorRequested : 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 NameDescription
finishedFloorRequestNotification to the Moderator when the Participant finishes Floor Access
floorFinishedAcknowledgment 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

CodeDescription
5003Unauthorized Access. When a user with a moderator role invokes finishFloor().
5041Repeated finishFloor() call while the previous request is in process.
5042When the participant retries finishFloor() after finishing the Floor Access.
5067Unable 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

CallbackDescription
processFloorRequestedThe moderator acknowledged that the floor is released
floorReleasedThe 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 released
floorReleased : event =>{
// event = { result:1712, msg:'Floor released', clientId: "XXX" }
}
//To moderator: Acknowledgement
processFloorRequested : 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

CallbackDescription
ackInviteToFloorRequestedAcknowledgment to the Moderator when an invitation to Floor is sent to the participant.
inviteToFloorRequestedNotification 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

CodeDescription
5086The Endpoint application is not connected to a Room.
5097inviteToFloor() is not applicable in a Chat-Only Room. Non-Contextual method call.
5006A user with a participant role is not authorized to invoke inviteToFloor().
5045Unable to invite a user with an invalid client ID.
5067Unable to process the request for a Room in group mode. Non-Contextual method call.