In Lecture Mode, only the moderator publishes a stream. Participants must request floor access to publish their audio or video. The Android SDK provides methods to request, grant, deny, release, and invite participants to the floor, giving the moderator full control over who speaks.
Floor Access Methods
Note: Call room.setChairControlObserver(this) once before invoking any floor access methods. This registers the observer that delivers all floor-related callbacks to your activity or fragment.
Request Floor Access
EnxRoom.requestFloor() lets a participant send a floor access request to the moderator. The participant receives an acknowledgment when the moderator receives the request, and the moderator is notified separately.
Class:EnxRoom
Method:public void requestFloor()
Observer:room.setChairControlObserver(this)
Participant only (moderators cannot request floor access)
Callback
Description
onFloorRequested
Acknowledgment to the participant when the moderator receives their request.
onFloorRequestReceived
Notification to the moderator when a participant's request is received.
room?.setChairControlObserver(myChairControlObserver)
room?.requestFloor()
override fun onFloorRequested(jsonObject: JSONObject?) {
// Your floor request was received by the moderator
}
override fun onFloorRequestReceived(jsonObject: JSONObject?) {
// Moderator: a participant has requested floor access
}
room.setChairControlObserver(this);
room.requestFloor();
public void onFloorRequested(JSONObject jsonObject) {
// Your floor request was received by the moderator
}
public void onFloorRequestReceived(JSONObject jsonObject) {
// Moderator: a participant has requested floor access
}
Error Code
Description
5003
Unauthorized — moderator cannot request floor access.
5041
A previous floor request is already in process.
5042
Floor request already registered.
5067
Non-contextual — room is in group mode, not lecture mode.
Cancel a Floor Request
EnxRoom.cancelFloor() allows a participant to withdraw a pending floor access request before the moderator has responded.
Class:EnxRoom
Method:public void cancelFloor()
Participant only
Callback
Description
onFloorCancelled
Acknowledgment to the participant when their request is cancelled.
onCancelledFloorRequest
Notification to the moderator when the participant cancels their request.
room?.cancelFloor()
override fun onFloorCancelled(jsonObject: JSONObject?) {
// Your floor request was cancelled
}
override fun onCancelledFloorRequest(jsonObject: JSONObject?) {
// Moderator: participant cancelled their floor request
}
room.cancelFloor();
public void onFloorCancelled(JSONObject jsonObject) {
// Your floor request was cancelled
}
public void onCancelledFloorRequest(JSONObject jsonObject) {
// Moderator: participant cancelled their floor request
}
Error Code
Description
5003
Unauthorized — moderator cannot cancel a floor request.
5041
A previous request is already in process.
5042
Floor request is already cancelled.
5067
Non-contextual — room is in group mode.
Grant Floor Access
EnxRoom.grantFloor(String clientId) gives floor access to a specific participant, allowing them to publish their stream. This method is available to the moderator only. Only one participant can hold floor access at a time — release the current holder's floor before granting to another.
Class:EnxRoom
Method:public void grantFloor(String clientId)
Parameter:clientId — the client ID of the participant to grant floor access.
Moderator only: Yes
Callback
Description
onProcessFloorRequested
Acknowledgment to the moderator when floor access is granted.
onGrantedFloor
Notification to the participant when they receive floor access — they can now publish.
room?.grantFloor(clientId)
override fun onProcessFloorRequested(jsonObject: JSONObject?) {
// Moderator: floor granted to participant
}
override fun onGrantedFloor(jsonObject: JSONObject?) {
// Participant: you have floor access — publish your stream
room?.publish(localStream)
}
room.grantFloor(clientId);
public void onProcessFloorRequested(JSONObject jsonObject) {
// Moderator: floor granted to participant
}
public void onGrantedFloor(JSONObject jsonObject) {
// Participant: you have floor access — publish your stream
room.publish(localStream);
}
Error Code
Description
5004
Unauthorized — participant cannot grant floor access.
5045
Invalid client ID.
5043
A previous grant request is already in process.
5044
Floor access is already granted to this participant.
5046
Another participant currently holds floor access — release it first.
5069
A floor release is currently in process.
5067
Non-contextual — room is in group mode.
Deny Floor Access
EnxRoom.denyFloor(String clientId) rejects a participant's floor access request. The moderator receives an acknowledgment and the participant is notified that their request was denied.
Class:EnxRoom
Method:public void denyFloor(String clientId)
Parameter:clientId — the client ID of the participant whose request is being denied.
Moderator only: Yes
Callback
Description
onProcessFloorRequested
Acknowledgment to the moderator when the denial is processed.
onDeniedFloorRequest
Notification to the participant that their floor request was denied.
room?.denyFloor(clientId)
override fun onProcessFloorRequested(jsonObject: JSONObject?) {
// Moderator: floor request denied
}
override fun onDeniedFloorRequest(jsonObject: JSONObject?) {
// Participant: your floor request was denied
}
room.denyFloor(clientId);
public void onProcessFloorRequested(JSONObject jsonObject) {
// Moderator: floor request denied
}
public void onDeniedFloorRequest(JSONObject jsonObject) {
// Participant: your floor request was denied
}
Non-contextual — floor has already been granted to this participant.
5067
Non-contextual — room is in group mode.
Finish Floor Access
EnxRoom.finishFloor() lets a participant announce that they are done speaking and voluntarily release the floor. All moderators are notified.
Class:EnxRoom
Method:public void finishFloor()
Participant only
Callback
Description
onFloorFinished
Acknowledgment to the participant when their floor access is finished.
onFinishedFloorRequest
Notification to all moderators that the participant has finished with floor access.
room?.finishFloor()
override fun onFloorFinished(jsonObject: JSONObject?) {
// Your floor access has ended
}
override fun onFinishedFloorRequest(jsonObject: JSONObject?) {
// Moderator: participant finished floor access
}
room.finishFloor();
public void onFloorFinished(JSONObject jsonObject) {
// Your floor access has ended
}
public void onFinishedFloorRequest(JSONObject jsonObject) {
// Moderator: participant finished floor access
}
Error Code
Description
5003
Unauthorized — moderator cannot finish floor access.
5041
A previous request is already in process.
5042
Floor access is already finished.
5067
Non-contextual — room is in group mode.
Note: In case of an error, <null> is received at the first index and error information at the second index of the response array.
Release Floor Access
EnxRoom.releaseFloor(String clientId) allows the moderator to forcibly revoke floor access from a participant. All participants are notified when floor access is released.
Class:EnxRoom
Method:public void releaseFloor(String clientId)
Parameter:clientId — the client ID of the participant whose floor access is being revoked.
Moderator only: Yes
Callback
Description
onProcessFloorRequested
Acknowledgment to the moderator when the release is processed.
onReleasedFloorRequest
Notification to all participants when floor access has been revoked.
room?.releaseFloor(clientId)
override fun onProcessFloorRequested(jsonObject: JSONObject?) {
// Moderator: floor released from participant
}
override fun onReleasedFloorRequest(jsonObject: JSONObject?) {
// Participant: your floor access has been revoked
}
room.releaseFloor(clientId);
public void onProcessFloorRequested(JSONObject jsonObject) {
// Moderator: floor released from participant
}
public void onReleasedFloorRequest(JSONObject jsonObject) {
// Participant: your floor access has been revoked
}
Non-contextual — no floor access has been granted to this participant.
5067
Non-contextual — room is in group mode.
Restore Moderator Session
If the moderator reconnects after a disconnection, retrieve the current floor state from room metadata so pending and active requests can be resumed:
room.getRoomMetaData().getJSONArray("raisedHands") — client IDs of participants with pending floor requests.
room.getRoomMetaData().getJSONArray("approvedHands") — client IDs of participants currently holding floor access.
Floor Invitation
These methods give the moderator additional control — instead of waiting for participants to request floor access, the moderator can proactively invite participants to speak.
Invite a Participant to the Floor
EnxRoom.inviteToFloor(String clientId) lets the moderator invite any participant to take the floor without waiting for a request. The invited participant receives a notification and can accept or reject the invitation.
Class:EnxRoom
Method:public void inviteToFloor(String clientId)
Parameter:clientId — the client ID of the participant to invite.
Moderator only: Yes
Callback
Description
onACKInviteToFloorRequested
Acknowledgment to the moderator when the invitation is sent.
onInviteToFloorRequested
Notification to all moderators in the room.
onInvitedForFloorAccess
Notification to the invited participant.
room?.inviteToFloor(clientId)
override fun onACKInviteToFloorRequested(jsonObject: JSONObject?) {
// Moderator: invitation sent
}
override fun onInviteToFloorRequested(jsonObject: JSONObject?) {
// All moderators notified
}
override fun onInvitedForFloorAccess(jsonObject: JSONObject?) {
// Participant: you have been invited to speak
}
EnxRoom.inviteToFloor(clientId);
@Override
public void onACKInviteToFloorRequested(JSONObject jsonObject) {
// Moderator: invitation sent
}
@Override
public void onInviteToFloorRequested(JSONObject jsonObject) {
// All moderators notified
}
@Override
public void onInvitedForFloorAccess(JSONObject jsonObject) {
// Participant: you have been invited to speak
}
Error Code
Description
5086
Not connected to room.
5097
Unauthorized — chat-only room.
5006
Unauthorized — participant cannot invite to floor.
5045
Invalid client ID.
5067
Non-contextual — room is in group mode.
Cancel a Floor Invitation
EnxRoom.cancelFloorInvite(String clientId) allows the moderator to withdraw an outstanding floor invitation before the participant has accepted or rejected it. The invited participant and all other moderators are notified.
EnxRoom.acceptInviteFloorRequest(String clientId) lets a participant accept the moderator's floor invitation. All moderators are notified when the participant accepts.