In Lecture Mode, only the Moderator publishes a stream to the room whereas all other participants subscribe to see and listen to the Moderator. If participants have questions to ask during the session, the Moderator can grant the floor to the participant to publish his stream.

Table of Contents

The following steps are used to implement Floor Access Control by moderator:

Request Floor Access

A participant’s request for floor access is forwarded to the Moderator using a notification event.

Method: requestFloor() – No parameter is needed.

Event Listeners:

  • onFloorRequested – Acknowledgement sent to the requesting participant that her request has been received by Moderator
  • onFloorRequestReceived– The Moderator receives requests from the participant
// To request floor access
window.EnxRtc.requestFloor();

// Add Event Listeners
// Your Request is received by Moderator.
window.EnxRtc.addEventListner("onFloorRequested",
function
(data)
{
console.log(JSON.stringify(data.data));
});

// Moderator receives floor access request
window.EnxRtc.addEventListner("onFloorRequestReceived",
(data)
{
console.log(JSON.stringify(data.data));
});

Cancel Requested Floor Access

A participant may cancel his request for Floor access which is pending at the Moderator’s end.

Method: cancelFloor() - No Parameter is required

Event Listeners: 

  • onCancelledFloorRequest - Moderator receives cancellation notification for a previously posted Floor access request from the participant
  • onFloorCancelled – Participant receives an acknowledgment that her request for Floor Request has been canceled.
// TO cancel request floor
window.EnxRtc.cancelFloor();

// Add Event Listeners
// Participant is acknowledged that floor request is cancelled.
window.EnxRtc.addEventListner("onFloorCancelled",
function
(data)
{
console.log(JSON.stringify(data.data));
});

// Moderator receives cancellation floor request.
window.EnxRtc.addEventListner("onCancelledFloorRequest",
(data)
{
console.log(JSON.stringify(data.data));
});

Deny Floor Access

The Moderator may also deny a request for floor access to a participant.

ClassEnxRoom

Method: denyFloor( clientID ) 

Parameters

  • @param {String} clientID – Client ID of the participant who has been denied floor access

Event Listeners:

  • onProcessFloorRequested – Moderator is notified that she denied floor access to a Participant
  • onDeniedFloorRequest – Participant is notified that she has been denied floor access
// To deny floor access to a client id
window.EnxRtc.denyFloor(clientID);

// Add Event Listeners
// Moderator notified when he denied floor access.
window.EnxRtc.addEventListner("onProcessFloorRequested",
(data)
function
{
console.log(JSON.stringify(data.data));
});

// Participant is notified that moderator is granted floor access.
window.EnxRtc.addEventListner("onDeniedFloorRequest",
{
function (data)console.log(JSON.stringify(data.data));
});

Grant Floor Access

Moderator might grant floor access to one or many users one by one. Note that at any given point of time, only one person may be granted floor access. To grant access to others, moderator must release floor access from the participant who is currently granted floor access. Once granted floor access, the designated participant will be notified using an event and he can publish his stream.

Method: grantFloor( clientID )

Parameters:

  • @param {String} clientId – Client ID of the User whom Floor Access is being granted.

Event Listeners:

  • onProcessFloorRequested – Moderator is acknowledged that Participant has been granted floor access
  • onGrantedFloorRequest – Participant receives floor access
// To grant floor access to a client id
window.EnxRtc.grantFloor(clientID);

// Add Event Listeners
// Moderator granted floor access to a participant.
window.EnxRtc.addEventListner("onProcessFloorRequested",
(data)
function
{
console.log(JSON.stringify(data.data));
});

// Participant is notified that he is granted floor access.
window.EnxRtc.addEventListner("onGrantedFloorRequest",
(data)
{
console.log(JSON.stringify(data.data));
function});

Finish Granted Floor Access

The Participant can end floor access granted to him by Moderator.

Method: finishFloor() – Participant ends floor access

Event Listeners:

  • onFinishedFloorRequest: Moderator receives notification that participant has ended floor access
  • onFloorFinished: Participant receives acknowledgement that she ended floor access
// To grant floor access to a client id
window.EnxRtc.finishFloor();

// Add Event Listeners
// Participant receive acknowledgement that he ended floor access
window.EnxRtc.addEventListner("onFloorFinished",
function (data)
console.log(JSON.stringify(data.data));
});

// Moderator notified that granted floor access to a participant has ended.
{window.EnxRtc.addEventListner("onFinishedFloorRequest",
(data)
function
{
console.log(JSON.stringify(data.data));
});

Release Floor Access

Moderator may terminate floor access granted to some participant. Upon termination, the user’s stream(s) is unpublished. It is necessary to terminate floor access of a participant before giving out floor access to another participant.

Method: releaseFloor( clientId )

Parameters:

  • @param {String} clientId – Client id of the participant whose floor access is being released.

Event Listeners:

  • onProcessFloorRequested – Moderator is acknowledged that the floor is being released
  • onReleasedFloorRequest – Participant is notified that floor access has been revoked. His stream is automatically unpublished.
// To release floor access to a client id
window.EnxRtc.releaseFloor(clientID);

// Add Event Listeners
// Moderator notified when he released floor access.
window.EnxRtc.addEventListner("onProcessFloorRequested",
(data)
{
console.log(JSON.stringify(data.data));
});
function

// Participant is notified that moderator is released floor access.
window.EnxRtc.addEventListner("onReleasedFloorRequest", (data)
function
{
console.log(JSON.stringify(data.data));
});

Restore Moderator Session

In case the Moderator is disconnected during a session, the list of received floor requests and participant currently with floor access can be retrieved when connection is restored to the room in the Room-Meta-Data viz.

Structured Data JSON

  • room.getRoomMetaData().getJSONArray("raisedHands")– An Array of Client Information who requested floor-access
  • room.getRoomMetaData().getJSONArray("approvedHands") An Array of Client-Information who currently has floor access