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:

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

CallbackDescription
onFloorRequestedAcknowledgment to the participant when the moderator receives their request.
onFloorRequestReceivedNotification to the moderator when a participant's access request is received.

Sample Code

// Initiate Chair Control Observer to receive Callbacks
room.setChairControlObserver(this);
room.requestFloor(); // To request floor access
public 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

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

CallbackDescription
onCancelledFloorRequestNotification to the moderator when the participant cancels the floor access request.
onFloorCancelledAcknowledgment to the participant when their floor access request is canceled.

Sample Code

room.cancelFloor();
// Moderator receives cancellation request
public void onCancelledFloorRequest(JSONObject jsonObject) {
// Handle JSONObject
}
// Participant is acknowedged that floor request is cancelled
public void onFloorCancelled(JSONObject jsonObject) {
// Handle JSONObject
}

Error Codes and Exceptions

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

CallbackDescription
onProcessFloorRequestedAcknowledgment to the moderator when the floor access is denied.
onDeniedFloorRequestNotification to the participant when the floor access is denied.

Sample Code

// Initiate Chair Control Observer to receive Callbacks
room.setChairControlObserver(this);
room.denyFloor(clientId); // To deny floor access to a clientId
public 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

CodeDescription
5005Unauthorized Access. A user with participant role invokes denyFloor().
5045An invalid Client ID is passed to denyFloor().
5047Repeated denyFloor() is called when the previous request is in process.
5048denyFloor() is called after granting floor access. Non-Contextual method is called.
5067Unable 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

CallbackDescription
onProcessFloorRequestedAcknowledgment to the moderator when participant is granted floor access.
onGrantedFloorNotification to the participant when floor access is received.

Sample Code

// Initiate Chair Control Observer to receive Callbacks
room.setChairControlObserver(this);
room.grantFloor(clientId); // To grant floor access to a clientId
public void onProcessFloorRequested(JSONObject jsonobject){
// You granted floor access to a Participant
}
public void onGrantedFloor(JSONObject jsonobject){
// Participant is notified that he is granted Floor Access
room.publish(localStream); // Publish now
}

Error Codes and Exceptions

CodeDescription
5004Unauthorized Access. When a participant uses role invokes grantFloor()
5045When grantFloor() is called with an invalid Client ID.
5043Repeated grantFloor() method is called when the previous request is in process.
5044Repeated grantFloor() is called after successfully granting the floor access.
5046grantFloor() to another participant without releasing the floor access from the existing participant.
5069Unable to grant floor access when floor release is in process.
5067Unable 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

CallbackDescription
onFinishedFloorRequestNotification to all the moderators when the participant finishes the floor access.
onFloorFinishedAcknowledgment to the participant when floor access is finished.

Sample Code

room.finishFloor();
// Moderator received Floor Finish notification
public void onFinishedFloorRequest(JSONObject jsonObject) {
// Handle JSONObject
}
// Participants is acknowledged that floor access is finished
public void onFloorFinished(JSONObject jsonObject) {
// Handle JSONObject
}

Error Codes and Exceptions

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

CallbackDescription
onProcessFloorRequested
onReleasedFloorRequestNot Applicable

Sample Code

// Initiate Chair Control Observer to receive Callbacks
room.setChairControlObserver(this);
room.releaseFloor(clientId); // To release floor access of the Participant
public 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

CodeDescription
5006Unauthorized Access. A user with participant role invokes releaseFloor().
5045Invalid Client ID passed to releaseFloor().
5049Repeated releaseFloor() is called when the previous request is in process.
5050releaseFloor() is called without granting floor access. Non-Contextual method call.
5067Unable 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

CallbackDescription
onACKInviteToFloorRequestedAcknowledgment to the moderator when an invitation to floor is sent to the participant.
onInviteToFloorRequestedNotification to all the moderators in the room when an invitation to floor is sent to the participant.
onInvitedForFloorAccessNotification 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 talk
EnxRoom.inviteToFloor(clientId);
//Acknowledgment to the moderator who invited
@Override
public void onACKInviteToFloorRequested(JSONObject jsonObject)
//Notification to all the moderators in the room
@Override
public void onInviteToFloorRequested(JSONObject jsonObject)
//Notification to the invited participant
@Override
public void onInvitedForFloorAccess(JSONObject jsonObject)

Error Codes and Exceptions

CodeDescription
5086Endpoint 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

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

CallbackDescription
onProcessFloorRequestedAcknowledgment to the moderator when cancel invitation request is sent to the participant.
onInviteToFloorRequestedNotification to all the moderators in the room when an invitation to floor is sent to the participant.
onCanceledFloorInviteNotification 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 Moderator
EnxRoom.cancelFloorInvite(clientId);
// Acknowledgment to the Moderator that Cancel Floor Invitation is initiated
@Override
public void onProcessFloorRequested(JSONObject jsonObject)
// Notification to the invited participant and other Moderators in the Room that invitation is canceled
@Override
public void onCanceledFloorInvite(JSONObject jsonObject)

Error Codes and Exceptions

CodeDescription
5086The endpoint application is not connected to the room.
5097cancelFloorInvite() is not applicable in a Chat-Only room. Non-contextual method call.
5006A user with a participant role is not authorized to invoke cancelFloorInvite().
5045Unable to cancel the invitation for an invalid client ID
5067Unable 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

CallbackDescription
onProcessFloorRequestedAcknowledgment to all the participant when they accept the invitation to the floor.
onAcceptedFloorInviteNotification 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 Floor
EnxRoom.acceptInviteFloorRequest(clientId);
// Acknowledgment to the Participant when they accept the invitation to the Floor
@Override
public void onProcessFloorRequested(JSONObject jsonObject)
// Notification to all the Moderators in the Room including the one who sent the invitation
@Override
public void onAcceptedFloorInvite(JSONObject jsonObject)

Error Codes and Exception

CodeDescription
5086The endpoint application is not connected to the room.
5097acceptInviteFloorRequest() is not applicable in a Chat-Only room. Non-contextual method call.
5006A user with a moderator role is not authorized to invoke acceptInviteFloorRequest().
5045Unable to accept the invitation for an invalid client ID.
5067Unable 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

CallbackDescription
onProcessFloorRequestedAcknowledgment to the participant when they reject the invitation to floor.
onRejectedInviteFloorNotification 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 Floor
EnxRoom.rejectInviteFloor(clientId);
// Acknowledgment to the Participant wen they reject invitation to the Floor
@Override
public void onProcessFloorRequested(JSONObject jsonObject)
// Notification to the Moderators when Participant rejects invitation to the Floor
@Override
public void onRejectedInviteFloor(JSONObject jsonObject)

Error Codes and Exceptions

CodeDescription
5086The endpoint application is not connected to the room.
5097rejectInviteFloor() is not applicable to a Chat-Only room. Non-contextual method call.
5006A user with a moderator role is not authorized to invoke rejectInviteFloor().
5045Unable to reject the invitation for an invalid client ID.
5067Unable to process the request for a room in Group mode. Non-contextual method call.