Floor Access Control

Floor Access Control is used in Lecture Mode sessions. In Lecture Mode, only the moderator can publish a stream into the room — participants can only subscribe to the moderator's stream. If a participant wants to speak or share their camera, they must first request floor access from the moderator.

The floor access lifecycle works as follows:

  1. A participant sends a floor request to the moderator
  2. The moderator grants or denies the request
  3. If granted, the participant can now publish their stream
  4. The participant finishes and releases the floor, or the moderator releases it
At any given time, only one participant can hold the floor. The moderator must release the current floor holder before granting floor access to another participant.
Request Floor Access

Participants call requestFloor() to ask the moderator for permission to publish their stream. The moderator receives the request and can act on it.

EventFired ToDescription
onFloorRequestedRequesting participantAcknowledges that the request was sent to the moderator
onFloorRequestReceivedModeratorDelivers the incoming floor request to the moderator
// Participant requests the floor
window.EnxRtc.requestFloor();

// Participant: request sent acknowledgement
window.EnxRtc.addEventListner("onFloorRequested", function(data) {
    console.log("Floor request sent:", JSON.stringify(data.data));
    showWaitingForFloorUI();
});

// Moderator: incoming floor request
window.EnxRtc.addEventListner("onFloorRequestReceived", function(data) {
    console.log("Floor request received:", JSON.stringify(data.data));
    showFloorRequestNotification(data.data.clientId, data.data.name);
});
Cancel a Floor Request

A participant can withdraw a pending floor request at any time before the moderator acts on it.

EventFired ToDescription
onFloorCancelledRequesting participantAcknowledges the floor request was cancelled
onCancelledFloorRequestModeratorNotifies the moderator that the participant withdrew their request
window.EnxRtc.cancelFloor();

// Participant: confirmed cancellation
window.EnxRtc.addEventListner("onFloorCancelled", function(data) {
    console.log("Floor request cancelled (self):", JSON.stringify(data.data));
    hideWaitingForFloorUI();
});

// Moderator: participant withdrew their request
window.EnxRtc.addEventListner("onCancelledFloorRequest", function(data) {
    console.log("Floor request withdrawn by:", JSON.stringify(data.data));
    removeFloorRequestFromList(data.data.clientId);
});
Grant Floor Access

The moderator calls grantFloor() to approve a participant's floor request. The approved participant gains the ability to publish their stream. The granted participant and all other moderators in the room are notified.

EventFired ToDescription
onProcessFloorRequestedModeratorAcknowledges the moderator's grant action
onGrantedFloorRequestGranted participant & other moderatorsNotifies the granted participant and moderators; includes the moderator's ID who granted it
window.EnxRtc.grantFloor(clientId);

// Moderator: action acknowledged
window.EnxRtc.addEventListner("onProcessFloorRequested", function(data) {
    console.log("Floor grant processed:", JSON.stringify(data.data));
});

// Granted participant and other moderators
window.EnxRtc.addEventListner("onGrantedFloorRequest", function(data) {
    console.log("Floor granted to:", JSON.stringify(data.data));
    if (data.data.clientId === myClientId) {
        enablePublishing(); // Start publishing your stream
    }
});
Deny Floor Access

The moderator calls denyFloor() to reject a participant's floor request. The denied participant and other moderators are notified.

EventFired ToDescription
onProcessFloorRequestedModeratorAcknowledges the deny action
onDeniedFloorRequestDenied participant & other moderatorsNotifies of the denial with the moderator's ID who denied it
window.EnxRtc.denyFloor(clientId);

window.EnxRtc.addEventListner("onProcessFloorRequested", function(data) {
    console.log("Floor deny processed:", JSON.stringify(data.data));
});

window.EnxRtc.addEventListner("onDeniedFloorRequest", function(data) {
    console.log("Floor denied:", JSON.stringify(data.data));
    if (data.data.clientId === myClientId) {
        showFloorDeniedMessage();
    }
});
Finish Floor Access

When a participant is done speaking or presenting, they call finishFloor() to announce the completion of their floor access and make the floor available for the next request.

EventFired ToDescription
onFloorFinishedParticipantAcknowledges the floor has been released by the participant
onFinishedFloorRequestAll moderatorsNotifies moderators that the participant has finished
window.EnxRtc.finishFloor();

// Participant confirmation
window.EnxRtc.addEventListner("onFloorFinished", function(data) {
    console.log("Floor finished (self):", JSON.stringify(data.data));
    disablePublishing();
});

// Moderator notification
window.EnxRtc.addEventListner("onFinishedFloorRequest", function(data) {
    console.log("Participant finished floor:", JSON.stringify(data.data));
    markFloorAvailable();
});
Release Floor Access

The moderator calls releaseFloor() to forcibly terminate a participant's active floor access. This unpublishes the participant's stream and makes the floor available for new requests.

EventFired ToDescription
onProcessFloorRequestedModeratorAcknowledges the release action
onReleasedFloorRequestReleased participant & other moderatorsNotifies of the release with the moderator's ID who triggered it
window.EnxRtc.releaseFloor(clientId);

window.EnxRtc.addEventListner("onProcessFloorRequested", function(data) {
    console.log("Floor release processed:", JSON.stringify(data.data));
});

window.EnxRtc.addEventListner("onReleasedFloorRequest", function(data) {
    console.log("Floor released for:", JSON.stringify(data.data));
    if (data.data.clientId === myClientId) {
        disablePublishing();
    }
});
Moderator Session Recovery

If the moderator's connection drops and later reconnects, the floor request queue is preserved by the server. On reconnection, the moderator can retrieve the current state from the room metadata:

Read these arrays inside your onRoomConnected handler after a reconnect to restore the moderator's UI without losing any pending floor state.