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 to deploy Control Floor Access by moderator:

Request Floor Access

A participant requests for Floor access is forwarded to the Moderator using a notification event.

Method: static Future<void> requestFloor() – No parameter needed. Participant requests floor access

Event Listners:

  • onFloorRequestReceived– The Moderator receives requests from Participant
EnxRtc.requestFloor(); // Request Floor Access

EnxRtc.onFloorRequestReceived= (Map<dynamic, dynamic> map) {
	 // Moderator receives floor access request 
	// map is { "clientId": "XXXX", "name": "iOS" }
};

Cancel Requested Floor Access

A participant may cancel his request for Floor access which is pending at Moderator Side.

Method: static Future<void> cancelFloor() - Participant cancels request floor access

Event Listeners

  • onCancelledFloorRequest: Moderator receives cancellation notification for already posted Floor Access Request from Participant
  • onFloorCancelled: Participant receives acknowledgement that his request for Floor Request has been cancelled.
EnxRtc.cancelFloor(); // Request Floor Cancellation

EnxRtc.onCancelledFloorRequest= (Map<dynamic, dynamic> map) {
	// Moderators are notified about Request Cancellation
};

EnxRtc.onFloorCancelled= (Map<dynamic, dynamic> map) {
	// Participant is notified about cancelled request
};

Deny Floor Access

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

ClassEnxRoom

Method: static Future<void> denyFloor(String clientId) – Moderator denies floor access to a Participant

Parameters

  • @param String clientId – Client id to deny floor.

Event Listeners:

  • onDeniedFloorRequest – Participant is notified that he has been denied floor access
EnxRtc. denyFloor(‘clientId’); // To deny floor request to CLientId

EnxRtc.onDeniedFloorRequest= (Map<dynamic, dynamic> map) {
	// Notification to the User that he floor access request is denied
	// map = { "result":4117,"msg":"Floor Request Denied","clientId":"XXX" }
};

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: static Future<void> grantFloor(String clientId) – moderator grants floor access to participant

Parameters:

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

Event Listeners:

  • onGrantFloorRequest – Participant receives floor access
EnxRtc.grantFloor(‘clientId’); // To grant floor access to ClientId

EnxRtc.onGrantedFloorRequest= (Map<dynamic, dynamic> map) {
   // Participant is notified that Floor Access is granted
   // map =  { "result":1708,"msg":"Floor Granted","clientId":"XXX" }
};

Finish Granted Floor Access

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

ClassEnxRoom

Method: static Future<void> finishFloor() – Participant finishes his granted Floor Access

Event Listeners:

  • onFinishedFloorRequest: Moderator receives notification that participant has finish granted Floor Access himself.
  • onFloorFinished: Participant receives acknowledgement that he finished granted Floor Access.
EnxRtc.finishFloor(); // To finish floor request

EnxRtc.onFinishedFloorRequest= (Map<dynamic, dynamic> map) { 
	// Moderator is notified that participant has
	// finished Floor Access himself
	/* map is {
		msg = Success;
		request =     {
		    id = processFloorRequest;
		    params =         {
			action = finishFloor;
			clientId = "ClentID";
		    };
		};
		result = 0;
	    }
	  */
};

EnxRtc. onFloorFinished= (Map<dynamic, dynamic> map) {
	// Participant is notified that floor access is finished
};

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: static Future<void> releaseFloor(String clientId) – Moderator asks participant to release floor

Parameters:

  • @param String clientId – Client id white floor access is being released.

Event Listners:

  • onReleasedFloorRequest – Participant i notified that floor access has been revoked. His stream is automatically unpublished.
EnxRtc.releaseFloor(‘clientId’); // Floor is released from clientId

EnxRtc.onReleasedFloorRequest = (Map<dynamic, dynamic> map) {
	// To notify participant that Floor Access is released
	// map = { "result":1712,"msg":"Floor released","clientId":"XXX" }
};

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