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

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.

Class: EnxRoom

Method: public void requestFloor() – No parameter required.

Observer: public void setChairControlObserver( EnxChairControlObserver-Object )

Callbacks:

  • onFloorRequested – Acknowledgment to the Participant when their request is received by the Moderator.
  • onFloorRequestReceived – Notification to the Moderator when a Participant’s access request is received.
// 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 & Exceptions:

CodeDescription
5003Unauthorized Access. When a user with a Moderator role invokes requestFloor().
5041Repeated requestFloor() call while the previous request is in process.
5042Repeated requestFloor() call 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 Requested Floor Access

The Enxroom.cancelFloor() method allows participants to cancel their request for Floor Access pending for Moderator’s approval.

ClassEnxRoom

Method: public void cancelFloor() - No Parameter required.

Callbacks

  • 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.
 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 & Exceptions

CodeDescription
5003Unauthorized Access. When a user with 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.

Deny Floor Access

The EnxRoom.denyFloor() method allows the Moderator to deny a Participant’s request for Floor Access.

ClassEnxRoom

Method: public void denyFloor(String clientID) 

Parameter:

clientID – Client ID of the Participant requesting Floor Access.

Observerpublic void setChairControlObserver( EnxChairControlObserver-Object )

Callbacks:

  • onProcessFloorRequested – Acknowledgment to the Moderator when the Floor Access has been denied.
  • onDeniedFloorRequest – Notification to the Participant when the Floor Access has been denied.
// 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 & Exceptions:

CodeDescription
5005Unauthorized Access. When a user with participant role invokes denyFloor().
5045When an invalid Client ID is passed to denyFloor().
5047Repeated denyFloor() call while the previous request is in process.
5048denyFloor() called after granting Floor Access. Non-Contextual Method Call.
5067Unable to process the request for a Room in group mode. Non-Contextual method call.

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.

Class: EnxRoom

Method: public void grantFloor(String clientID)

Observer: public void setChairControlObserver( EnxChairControlObserver-Object )

Callbacks:

  • onProcessFloorRequested – Acknowledgment to the Moderator when Participant is granted Floor Access.
  • onGrantedFloor – Notification to the Participant when Floor Access is received.
// 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 & Exceptions

CodeDescription
5004Unauthorized Access. When a user with participant role invokes grantFloor().
5045When Invalid Client ID is passed to grantFloor().
5043Repeated grantFloor() call while the previous request is in process.
5044Repeated grantFloor() call after successfully granting 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 group mode. Non-Contextual method call.

Finish Floor Access

The EnxRoom.finishFloor() allows the Participant to announce the completion of Floor Access and release Floor Access.

ClassEnxRoom

Method: public void finishFloor() – No Parameter required.

Callbacks: 

  • onFinishedFloorRequest: Notification to the Moderator when the Participant finishes Floor Access.
  • onFloorFinished: Acknowledgment to the Participant when Floor Access is finished.
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 & Exceptions

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

Class: EnxRoom

Method: public void releaseFloor(String clientId)

Parameter:

clientId – Client ID of the Participant whose Floor Access is being released.

Observer: public void setChairControlObserver( EnxChairControlObserver-Object )

Callbacks:

  • onProcessFloorRequested – Acknowledgment to the Moderator when the Floor Access is released.
  • onReleasedFloorRequest – Notification to the Participant when their Floor Access is revoked.
// 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 & Exceptions:

CodeDescription
5006Unauthorized Access. When a user with participant role invokes releaseFloor()
5045Invalid Client ID passed to releaseFloor().
5049Repeated releaseFloor() call while the previous request is in process.
5050releaseFloor() called without granting Floor Access. Non-Contextual Method Call.
5067Unable to process the request for a Room in group mode. Non-Contextual method call.

Note: The Object EnxRoom.setChairControlObserver() needs to be called only once for any one or all of the above methods to receive callbacks.

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.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 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.

Class: EnxRoom

Method: public void inviteToFloor(String clientId) 

Parameter:

clientId – String. The client ID of the invited Participant.

Callback:

  1. onACKInviteToFloorRequested – Acknowledgment to the Moderator when an invitation to Floor is sent to the Participant.

Response Body:

{
   msg = Success; 
   result = 0;
} 
  • onInviteToFloorRequested – Notification to all the Moderators in the Room when an invitation to Floor is sent to the Participant.

Response Body:

{
    clientId = "cae0afbc-fb94-4743-8c04-ae48e9d3eb52"; 
    id = inviteToFloor; 
    name = Jay;
} 
  • onInvitedForFloorAccess – Notification to the invited Participant when an invitation to Floor is received.

Response Body:

 {  
        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 & Exceptions:

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

Cancel Invitation to Floor

The EnxRoom.cancelFloorInvite() method allows the Moderator to cancel a Floor Invitation sent to a Participant.

Class: EnxRoom

Method: public void cancelFloorInvite(String clientId)

Parameter:

clientId – Client Id of the Participant whose invitation needs to be canceled.

Callback:

  • onProcessFloorRequested – Acknowledgment to the Moderator when Cancel Invitation request is sent to the Participant.

Response Body:

{ 
    msg = Success; 
    request =  { 
        id = processFloorRequest; 
 	params =  { 
            action = cancelFloorInvite;
            clientId = "cae0afbc-fb94-4743-8c04-ae48e9d3eb52"; 
       		}; 
	}; 
  	result = 0; 
} 
  • onCanceledFloorInvite – Notification to the invited Participant and other Moderators in the Room when invitation is canceled by the Moderator.

Response Body for the Participant:

{ 
        clientId = "a067fd70-1461-4ca4-befc-2b570c0db494"; 
        id = cancelFloorInvite; 
        moderator = "e2b48879-3754-49f2-bf86-08a73347e408"; 
        name = JayiOS; 
} 

Response Body 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 & Exceptions:

CodeDescription
5086 Endpoint application is not connected to a Room. 
5097cancelFloorInvite() 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 invitation for an invalid client ID. 
5067Unable to process the request for a Room in group mode. Non-Contextual method call.

Accept Invitation to Floor

The EnxRoom.acceptInviteFloorRequest() method allows the Participant to accept the invitation to the Floor and talk.

Class: EnxRoom

Method: public void acceptInviteFloorRequest(String clientId) 

Parameter:

clientId – Client Id of the Participant who has received the invitation to the Floor.

Callbacks:

  • onProcessFloorRequested – Acknowledgment to the Participant when they accept the invitation to the Floor.

Response Body:

{ 
    msg = Success; 
    request =     { 
        id = processFloorRequest; 
        params =  { 
            action = acceptFloor; 
            clientId = "18c9b8bb-142e-44a7-b30b-6701cd9e62d9"; 
        }; 
    }; 
    result = 0;
} 
  • onAcceptedFloorInvite – Notification to all the Moderators in the Room including the one who sent the invitation when the Participant accepts invitation.

Response Body:

{ 
        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 & Exception:

CodeDescription
5086 Endpoint application is not connected to a Room. 
5097acceptInviteFloorRequest() 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 Invitation to Floor

The EnxRoom.rejectInviteFloor() method allows the invited Participant to reject the invitation to the Floor.

Class: EnxRoom

Method: public void rejectInviteFloor(String clientId) 

Parameter:

clientId – Client Id of the Participant who has received the invitation to the Floor.

Callbacks:

  • onProcessFloorRequested – Acknowledgment to the Participant when they reject the invitation to Floor.

Response Body:

{ 
    msg = Success; 
    request =     { 
        id = processFloorRequest; 
        params =  { 
            action = rejectFloor; 
            clientId = "87184b36-26b3-4450-b908-6d9de6a457c5"; 
        }; 
    }; 
    result = 0; 
} 
  • onRejectedInviteFloor – Notification to all the Moderators including the one who sent the invitation when the Participant rejects the invitation.

Response Body:

{ 
        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 & Exceptions:

CodeDescription
5086 Endpoint application is not connected to a Room. 
5097rejectInviteFloor() not applicable in 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.