Floor Access Control
In Lecture Mode, only the moderator can publish a stream in a room, and the participants can only subscribe to the moderator's stream. If a participant wants to publish a stream during the session, the participant must request the moderator for floor access to do this.
The Android SDK provides the following methods for managing floor access:
- requestFloor(): To request the moderator for floor access.
- cancelFloor(): To cancel the request for floor access.
- denyFloor(): To deny a participant's request for floor access.
- grantFloor(): To grant floor access to one or more participants in sequence.
- finishFloor(): To announce the completion of floor access and its availability for subsequent requests.
- releaseFloor(): To terminate floor access granted to a participant.
- inviteToFloor(): To invite a participant of an ongoing conference to the floor.
- cancelFloorInvite(): To cancel a floor invitation.
- acceptInviteFloorRequest(): To accept invitation to a floor and talk.
- rejectInviteFloor(): To reject invitation to a floor.
Request Floor Access
The EnxRoom.requestFloor()
method allows a participant to request the moderator for floor access.
Class: EnxRoom
Method: public void requestFloor()
Observer: public void setChairControlObserver( EnxChairControlObserver-Object )
Callbacks
Callback | Description |
---|---|
onFloorRequested | Acknowledgment to the participant when the moderator receives their request. |
onFloorRequestReceived | Notification to the moderator when a participant's access request is received. |
Sample Code
// Initiate Chair Control Observer to receive Callbacksroom.setChairControlObserver(this);room.requestFloor(); // To request floor accesspublic void onFloorRequested(JSONObject jsonobject){// Your Request is received by Moderator}public void onFloorRequestReceived(JSONObject jsonobject){// Moderator receives floor access request// JSON has requesting participant information}
Error Codes and Exceptions
Code | Description |
---|---|
5003 | Unauthorized Access. When a user with a moderator role invokes requestFloor(). |
5041 | Repeated requestFloor() is called when a previous request is in process. |
5042 | Repeated requestFloor() is called after the request has already been registered with the moderator. |
5067 | Unable to process the request for a room in group mode. Non-Contextual method call. |
Cancel a Requested Floor Access
The Enxroom.cancelFloor()
method allows participants to cancel their request for pending floor access for moderator's approval.
Class: Enxroom
Method: public void cancelFloor()
Callbacks
Callback | Description |
---|---|
onCancelledFloorRequest | Notification to the moderator when the participant cancels the floor access request. |
onFloorCancelled | Acknowledgment to the participant when their floor access request is canceled. |
Sample Code
room.cancelFloor();// Moderator receives cancellation requestpublic void onCancelledFloorRequest(JSONObject jsonObject) {// Handle JSONObject}// Participant is acknowedged that floor request is cancelledpublic void onFloorCancelled(JSONObject jsonObject) {// Handle JSONObject}
Error Codes and Exceptions
Code | Description |
---|---|
5003 | Unauthorized Access. A user with moderator role invokes cancelFloor(). |
5041 | Repeated cancelFloor() is called when a previous request is in process. |
5042 | Repeated cancelFloor() is called after the request has already been canceled. |
5067 | Unable to process the request for a room in a group mode. Non-Contextual method call. |
Deny Floor Access
The EnxRoom.denyFloor()
method allows moderators to deny a Participant's request for floor access.
Class: EnxRoom
Method: public void denyFloor(String clientID)
Parameter: clientID
: String. Client ID of the participant requesting for floor access.
Observer: public void setChairControlObserver( EnxChairControlObserver-Object )
Callbacks
Callback | Description |
---|---|
onProcessFloorRequested | Acknowledgment to the moderator when the floor access is denied. |
onDeniedFloorRequest | Notification to the participant when the floor access is denied. |
Sample Code
// Initiate Chair Control Observer to receive Callbacksroom.setChairControlObserver(this);room.denyFloor(clientId); // To deny floor access to a clientIdpublic void onProcessFloorRequested(JSONObject jsonobject){// You denied floor access to a Participant}public void onDeniedFloorRequest(JSONObject jsonobject){// Participant is notified that he is denied Floor Access}
Error Codes and Exceptions
Code | Description |
---|---|
5005 | Unauthorized Access. A user with participant role invokes denyFloor(). |
5045 | An invalid Client ID is passed to denyFloor(). |
5047 | Repeated denyFloor() is called when the previous request is in process. |
5048 | denyFloor() is called after granting floor access. Non-Contextual method is called. |
5067 | Unable to process the request for a room in a group mode. Non-Contextual method is called. |
Grant Floor Access
The EnxRoom.grantFloor()
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.
Class: EnxRoom
Method: public void grantFloor(String clientID)
Observer: public void setChairControlObserver( EnxChairControlObserver-Object )
Callbacks
Callback | Description |
---|---|
onProcessFloorRequested | Acknowledgment to the moderator when participant is granted floor access. |
onGrantedFloor | Notification to the participant when floor access is received. |
Sample Code
// Initiate Chair Control Observer to receive Callbacksroom.setChairControlObserver(this);room.grantFloor(clientId); // To grant floor access to a clientIdpublic void onProcessFloorRequested(JSONObject jsonobject){// You granted floor access to a Participant}public void onGrantedFloor(JSONObject jsonobject){// Participant is notified that he is granted Floor Accessroom.publish(localStream); // Publish now}
Error Codes and Exceptions
Code | Description |
---|---|
5004 | Unauthorized Access. When a participant uses role invokes grantFloor() |
5045 | When grantFloor() is called with an invalid Client ID. |
5043 | Repeated grantFloor() method is called when the previous request is in process. |
5044 | Repeated grantFloor() is called after successfully granting the floor access. |
5046 | grantFloor() to another participant without releasing the floor access from the existing participant. |
5069 | Unable to grant floor access when floor release is in process. |
5067 | Unable to process the request for a room in a group mode. Non-Contextual method call. |
Complete a Granted Floor Access
The EnxRoom.finishFloor()
allows participants to announce the completion and release of floor access.
Class: EnxRoom
Method: public void finishFloor()
Callbacks
Callback | Description |
---|---|
onFinishedFloorRequest | Notification to all the moderators when the participant finishes the floor access. |
onFloorFinished | Acknowledgment to the participant when floor access is finished. |
Sample Code
room.finishFloor();// Moderator received Floor Finish notificationpublic void onFinishedFloorRequest(JSONObject jsonObject) {// Handle JSONObject}// Participants is acknowledged that floor access is finishedpublic void onFloorFinished(JSONObject jsonObject) {// Handle JSONObject}
Error Codes and Exceptions
Code | Description |
---|---|
5003 | Unauthorized Access. A user with moderator role invokes finishFloor(). |
5041 | Repeated finishFloor() is called when the previous request is in process. |
5042 | When participant retries finishFloor() is called after finishing the floor access. |
5067 | Unable to process the request for a room in a 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 Enxroom.releaseFloor()
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.
Class: Enxroom
Method: public void releaseFloor(String clientId)
Parameter: clientID
: String. Client ID of the participant whose floor access will be released.
Observer: public void setChairControlObserver( EnxChairControlObserver-Object )
Callbacks
Callback | Description |
---|---|
onProcessFloorRequested | |
onReleasedFloorRequest | Not Applicable |
Sample Code
// Initiate Chair Control Observer to receive Callbacksroom.setChairControlObserver(this);room.releaseFloor(clientId); // To release floor access of the Participantpublic void onProcessFloorRequested(JSONObject jsonobject){// You got floor access released from the Participant}public void onReleasedFloorRequest(JSONObject jsonobject){// Participant is notified that floor access is revoked}
Error Codes and Exceptions
Code | Description |
---|---|
5006 | Unauthorized Access. A user with participant role invokes releaseFloor(). |
5045 | Invalid Client ID passed to releaseFloor(). |
5049 | Repeated releaseFloor() is called when the previous request is in process. |
5050 | releaseFloor() is called without granting floor access. Non-Contextual method call. |
5067 | Unable to process the request for a room in a group mode. Non-Contextual method call. |
Note: The Object EnxRoom.setChairControlObserver()
is called only once for any or all of the above methods to receive callbacks.
Restore a Moderator's Session
If a moderator is disconnected during a session, the list of floor access requests and participants currently with floor access can be retrieved through the room metadata when the moderator is reconnected.
Structured Data JSON
room.getRoomMetaData().getJSONArray("raisedHands")
: An array of Client IDs requesting floor access.room.getRoomMetaData().getJSONArray("approvedHands")
: An array of Client IDs currently having floor access.
Invite to Floor
In the Lecture mode, where only a moderator can speak and control speakers in the room through Floor Access Control methods, the Invite Floor methods provide more options to the moderator to organize a conference in this mode.
Invite Participants to a Floor
The EnxRoom.inviteToFloor()
method allows moderators to invite any participants in the ongoing conference to the floor and talk.
Class: EnxRoom
Method: public void inviteToFloor(String clientId)
Parameters: clientID
: String. The client ID of the invited participant.
Callbacks
Callback | Description |
---|---|
onACKInviteToFloorRequested | Acknowledgment to the moderator when an invitation to floor is sent to the participant. |
onInviteToFloorRequested | Notification to all the moderators in the room when an invitation to floor is sent to the participant. |
onInvitedForFloorAccess | Notification to the invited participant when an invitation to floor is received. |
Sample Code
Sample Response 1
{msg = Success;result = 0;}
Sample Response 2
{clientId = "cae0afbc-fb94-4743-8c04-ae48e9d3eb52";id = inviteToFloor;name = Jay;}
Sample Response 3
{clientId = "9554a040-58bd-4f0b-a010-7f92c54b2918";id = inviteToFloor;moderator = "e2b48879-3754-49f2-bf86-08a73347e408";name = Jay;}
// invitation sent to participant to come on floor and talkEnxRoom.inviteToFloor(clientId);//Acknowledgment to the moderator who invited@Overridepublic void onACKInviteToFloorRequested(JSONObject jsonObject)//Notification to all the moderators in the room@Overridepublic void onInviteToFloorRequested(JSONObject jsonObject)//Notification to the invited participant@Overridepublic void onInvitedForFloorAccess(JSONObject jsonObject)
Error Codes and 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 |
5067 | Unable to process the request for a Room in group mode. Non-Contextual method call |
Cancel Floor Invitation
The EnxRoom.cancelFloorInvite()
method allows moderators to cancel a floor invitation sent to a participant.
Class: EnxRoom
Method: public void cancelFloorInvite(String clientId)
Parameter: clientID
: String. Client Id of the participant whose invitation needs to be canceled.
Callbacks
Callback | Description |
---|---|
onProcessFloorRequested | Acknowledgment to the moderator when cancel invitation request is sent to the participant. |
onInviteToFloorRequested | Notification to all the moderators in the room when an invitation to floor is sent to the participant. |
onCanceledFloorInvite | Notification to the invited participant and other moderators in the room when the moderator cancels the invitation. |
Sample Code
** Sample Response**
{msg = Success;request = {id = processFloorRequest;params = {action = cancelFloorInvite;clientId = "cae0afbc-fb94-4743-8c04-ae48e9d3eb52";};};result = 0;}
Sample Response for a Participant
{clientId = "a067fd70-1461-4ca4-befc-2b570c0db494";id = cancelFloorInvite;moderator = "e2b48879-3754-49f2-bf86-08a73347e408";name = JayiOS;}
Sample Response for Other Moderators
{clientId = "ade30ef1-595d-4364-b4f5-1d9420f24b0f";id = cancelFloorInvite;name = JayiOS;}
// Cancel Floor invitation request sent by the ModeratorEnxRoom.cancelFloorInvite(clientId);// Acknowledgment to the Moderator that Cancel Floor Invitation is initiated@Overridepublic void onProcessFloorRequested(JSONObject jsonObject)// Notification to the invited participant and other Moderators in the Room that invitation is canceled@Overridepublic void onCanceledFloorInvite(JSONObject jsonObject)
Error Codes and Exceptions
Code | Description |
---|---|
5086 | The endpoint application is not connected to the room. |
5097 | cancelFloorInvite() is 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 |
5067 | Unable to process the request for a room in group mode. Non-Contextual method call. |
Accept Floor Invitation
The EnxRoom.acceptInviteFloorRequest()
method allows participants to accept the invitation to the floor and talk.
Class: EnxRoom
Method: public void acceptInviteFloorRequest(String clientId)
Parameter: clientID
: String. Client Id of the participant who has received the invitation to the floor.
Callbacks
Callback | Description |
---|---|
onProcessFloorRequested | Acknowledgment to all the participant when they accept the invitation to the floor. |
onAcceptedFloorInvite | Notification to all the moderators in the room, including the one who sent the invitation, when the participant accepts the invitation. |
Sample Code
Sample Response 1
{msg = Success;request = {id = processFloorRequest;params = {action = acceptFloor;clientId = "18c9b8bb-142e-44a7-b30b-6701cd9e62d9";};};result = 0;}
Sample Response 2
{clientId = "8ed7241c-36d9-4224-b8f3-7d015718d09e";id = floorAccepted;msg = "Floor accepted";result = 1738;}
// Participant accepts the invitation to FloorEnxRoom.acceptInviteFloorRequest(clientId);// Acknowledgment to the Participant when they accept the invitation to the Floor@Overridepublic void onProcessFloorRequested(JSONObject jsonObject)// Notification to all the Moderators in the Room including the one who sent the invitation@Overridepublic void onAcceptedFloorInvite(JSONObject jsonObject)
Error Codes and Exception
Code | Description |
---|---|
5086 | The endpoint application is not connected to the room. |
5097 | acceptInviteFloorRequest() is not applicable in a Chat-Only room. Non-contextual method call. |
5006 | A user with a moderator role is not authorized to invoke acceptInviteFloorRequest(). |
5045 | Unable to accept the invitation for an invalid client ID. |
5067 | Unable to process the request for a room in group mode. Non-Contextual method call. |
Reject Floor Invitation
The EnxRoom.rejectInviteFloor()
method allows invited participants to reject the floor invitation.
Class: EnxRoom
Method: public void rejectInviteFloor(String clientId)
Parameter: clientID
: String. Client Id of the participant who has received the invitation to the floor.
Callbacks
Callback | Description |
---|---|
onProcessFloorRequested | Acknowledgment to the participant when they reject the invitation to floor. |
onRejectedInviteFloor | Notification to all the moderators, including the one who sent the invitation, when the participant rejects the invitation. |
Sample Code
Sample Response 1
{msg = Success;request = {id = processFloorRequest;params = {action = rejectFloor;clientId = "87184b36-26b3-4450-b908-6d9de6a457c5";};};result = 0;}
Sample Response 2
{clientId = "57ab3a52-2d85-4a22-a4b4-d58b90ea84ec";id = floorRejected;msg = "Floor Denied";result = 1709;}
// Participant rejects invitation to FloorEnxRoom.rejectInviteFloor(clientId);// Acknowledgment to the Participant wen they reject invitation to the Floor@Overridepublic void onProcessFloorRequested(JSONObject jsonObject)// Notification to the Moderators when Participant rejects invitation to the Floor@Overridepublic void onRejectedInviteFloor(JSONObject jsonObject)
Error Codes and Exceptions
Code | Description |
---|---|
5086 | The endpoint application is not connected to the room. |
5097 | rejectInviteFloor() is not applicable to a Chat-Only room. Non-contextual method call. |
5006 | A user with a moderator role is not authorized to invoke rejectInviteFloor(). |
5045 | Unable to reject the invitation for an invalid client ID. |
5067 | Unable to process the request for a room in Group mode. Non-contextual method call. |