Floor Access Control

In the Lecture Mode, only the moderator can publish a stream in a room, and the participants can only subscribe to the moderator's stream. If participants want to publish their streams during a session, they must request the moderator for floor access to do this.

The iOS SDK provides the following methods for managing floor access:

Request Floor Access

The EnxRoom.requestFloor() method allows a participant to request the moderator for floor access.

Class: EnxRoom

Method: - (void)requestFloor;

Delegate Method: - didFloorRequestReceived:: Notification to the moderator when a participant's access request is received.

Sample Code

[room requestFloor];
-(void)didFloorRequestReceived:(NSArray )Data{
/*Data is
[ {
"clientId": "XXXX", // Who requested
"name": "iOS"
},
"<null>"
]
*/
}

Error Codes and Exceptions

CodeDesription
5003Unauthorized access. When a user with a moderator role invokes requestFloor().
5041Repeated requestFloor() call when 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 the group mode. Non-contextual method call.

Note: In case of an error, <null> is received in the first index and error information in the second index.

Cancel a Requested Floor Access

The Enxroom.cancelFloor() method allows participants to cancel their floor access requests pending moderator approval.

Class: Enxroom

Method: (void)cancelFloor;

Delegate Methods:

Delegate MethodDescription
- room:didCancelledFloorRequest:Notification to the moderator when a participant cancels a floor access request.
– room:didFloorCancelled:Acknowledgement to the participant when the participant's floor access request is canceled.

Sample Code

[room cancelFloor];
//Moderator receives cancellation request
-(void)didCancelledFloorRequest:(NSArray )Data;
/*Data is
[ {
"clientId": "XXXX", // Who requested
"name": "iOS"
},
"<null>"
]
*/
}
// Participant receives acknowledgement
-(void)didFloorCancelled:(NSArray )Data;
/*Data is
[ {
"clientId": "XXXX", // Who requested
"name": "iOS"
},
"<null>"
]
*/
}

Error Codes and Exceptions

CodeDescription
5003Unauthorized Access. 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.

Note: In case of an error, <null> is received in the first index and error information in the second index.

Deny Floor Access

The EnxRoom.denyFloor() method allows a moderator to deny a participant's request for floor access.

Class: EnxRoom

Method: (void)denyFloor:(NSString *)clientId;

Parameter: clientId: String. Client ID of the participant requesting floor access.

Event Notifications:

Event NotificationDescription
\- didDeniedFloorRequest:Notification to the participant when the participant's floor access request is denied.
\- didProcessFloorRequested:Acknowledgment to the moderator when the floor access request is denied.

Sample Code

[room denyFloor:@"clientId"]; // Moderator denies floor access
// Participant is notified about denied floor access
-(void)didDeniedFloorRequest:(NSArray )Data{
/* Data is
[ {
"result":4117,
"msg":"Floor Request Denied",
"clientId":"XXX"
},
"<null>"
] */
}

Error Codes and Exceptions

CodeDescription
5005Unauthorized Access. A user with the participant role has invoked 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 the Group mode. Non-contextual method call.

Note: In case of an error, <null> is received in the first index and error information in the second index.

Grant Floor Access

The EnxRoom.grantFloor() method allows the moderator to grant floor access to one or more participants individually. Note that at any given time, only one participant can be granted floor access. To grant floor access to other participants, the moderator must release floor access from the existing participant.

Class: EnxRoom

Method: (void)grantFloor:(NSString *)clientId;

Delegate Method:

Delegate MethodDescription
- didGrantedFloorRequest:Notification to the participant when the floor access is received.
- didProcessFloorRequested:Acknowledgment to the moderator when the participant is granted floor access.

Sample Code

[room grantFloor:@"clientId"]; // Moderator grants floor access
// Participant receives floor access
-(void) didGrantedFloorRequest:(NSArray *)Data{
/* Data is
[ {
"result":1708,
"msg":"Floor Granted",
"clientId":"XXX"
},
"<null>"
] */
}

Error Codes and Exceptions

CodeDescription
5004Unauthorized access. When a user with the participant role invokes grantFloor().
5045Invalid 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 from the existing participant.
5069Unable to grant floor access when the floor release is in process.
5067Unable to process the request for a room in the Group mode. Non-contextual method call.

Note: In case of an error, <null> is received in the first index and error information in the second index.

Complete a Granted Floor Access

The EnxRoom.finishFloor() method allows participants to announce the completion of floor access and availability of floor for subsequent requests.

Class: EnxRoom

Method: (void)finishFloor;

Delegate Methods:

Delegate MethodDescription
- room:didFinishedFloorRequest:Notification to the moderator when a participant finishes floor access.
– room:didFloorFinished:Acknowledgement to a participant when the participant's floor access is finished.

Sample Code

[room finishFloor];
//Moderator receives finished floor access
(void)didFinishedFloorRequest:(NSArray )Data;
/*Data is
[ {
"clientId": "XXXX", // Who requested
"name": "iOS"
},
"<null>"
]
*/
}
// Participant receives acknowledgement
-(void)didFloorFinished:(NSArray )Data;
/*Data is
[ {
"clientId": "XXXX", // Who requested
"name": "iOS"
},
"<null>"
]
*/
}

Error Codes and Exceptions

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

Release Floor Access

The Enxroom.releaseFloor() method allows moderators to terminate the floor access granted to a participant. It unpublishes the participant's streams and makes the floor available for access.

Class: Enxroom

Method: (void)releaseFloor:(NSString *)clientId;

Parameter: clientId: String. Client ID of the participant whose floor access is being released.

Delegate Methods:

Delegate MethodDescription
\- didReleasedFloorRequest:Notification to the participant whose floor access is revoked.
\- didProcessFloorRequested:Acknowledgment to the moderator when the floor access is released.

Sample Code

[room releaseFloor:@"clientId"]; // Moderator revokes floor access
// Participant is notified moderator has revoked floor access
-(void)didReleasedFloorRequest:(NSArray )Data{
/* Data is
[ {
"result":1712,
"msg":"Floor Released",
"clientId":"XXXX"
},
"<null>"
] */
}

Error Codes and Exceptions

CodeDescription
5006Unauthorized access. When a user with the participant role invokes releaseFloor().
5045Invalid Client ID passed to releaseFloor().
5049Repeated releaseFloor() call when 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: In case of an error, <null> is received in the first index and error information in the second index.

Restore the Moderator in a Session

If the moderator is disconnected during a session, the list of floor access requests and participants currently with the floor access can be retrieved through the room meta data when the moderator is reconnected.

Structured Data JSON

  • room.roomMetaData[@"raisedHands"]: An array of Client IDs requesting floor access.
  • room.roomMetaData[@"approvedHands"]: An array of Client IDs currently having floor access.

Invite to Floor

In the Lecture mode, where only a moderator can speak and control speakers in the room through the Floor Access Control methods, the Invite to Floor methods provide more options to the moderator to organize a conference in this mode.

Invite Participants to the Floor

The EnxRoom.inviteToFloor() method allows moderators to invite participants from an ongoing conference to the floor and talk.

Class: EnxRoom

Method: (void)inviteToFloor:(NSString* _Nonnull)clientId

Parameter: clientId: String. The client ID of the invited participant.

Delegate Methods:

Delegate MethodDescription
didACKInviteToFloorRequestedAcknowledgement to the moderator when a floor invitation is sent to a participant.
didInviteToFloorRequestedNotification to all the moderators in the room when a floor invitation is sent to a participant.
didInvitedForFloorAccessNotification to the invited participant when the participant receives a floor invitation.

Sample Response

{
msg = Success;
result = 0;
}

Sample Response

{
clientId = "cae0afbc-fb94-4743-8c04-ae48e9d3eb52";
id = inviteToFloor;
name = Jay;
}

Sample Response

{
clientId = "9554a040-58bd-4f0b-a010-7f92c54b2918";
id = inviteToFloor;
moderator = "e2b48879-3754-49f2-bf86-08a73347e408";
name = Jay;
}

Sample Code

// invitation sent to participant to come on floor and talk
[EnxRoom inviteToFloor:"ClientID"];
//Acknowledgment to the moderator who invited
-(void)didACKInviteToFloorRequested:(NSArray *_Nullable)Data;
//Notification to all the moderators in the room
-(void)didInviteToFloorRequested:(NSArray *_Nullable)Data;
//Notification to the invited participant
-(void)didInvitedForFloorAccess:(NSArray *_Nullable)Data;

Error Codes and Exceptions

CodeDescription
5086The endpoint application is not connected to the room.
5097inviteToFloor() is not applicable in a chat-only room. Non-contextual method call.
5006A user with the 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 a Floor Invitation

The EnxRoom.cancelFloorInvite() method allows moderators to cancel a floor invitation sent to a participant.

Class: EnxRoom

Method: (void)cancelFloorInvite:(NSString* _Nonnull)clientId;

Parameter: clientId: String. Client Id of the participant whose invitation needs to be canceled.

Delegate Methods:

Delegate MethodDescription
didProcessFloorRequestedAcknowledgement to the moderator when the floor access cancelation request is sent to the Participant.
didCanceledFloorInviteNotification to the invited participant and other moderators in the room when the participant's floor access invitation is canceled by the moderator.

Sample Response

{
msg = Success;
request = {
id = processFloorRequest;
params = {
action = cancelFloorInvite;
clientId = "cae0afbc-fb94-4743-8c04-ae48e9d3eb52";
};
};
result = 0;
}

Sample Response (for the Participant)

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

Sample Response (for other Moderators)

{
clientId = "ade30ef1-595d-4364-b4f5-1d9420f24b0f";
id = cancelFloorInvite;
name = JayiOS;
}

Sample Code

// Cancel Floor invitation request sent by the Moderator
[EnxRoom cancelFloorInvite:"ClientID"];
// Acknowledgment to the Moderator that Cancel Floor Invitation is initiated
- (void)didProcessFloorRequested:(NSArray *_Nullable)Data;
// Notification to the invited participant and other Moderators in the Room that invitation is canceled
-(void)didCanceledFloorInvite:(NSArray *_Nullable)Data

Error Codes and Exceptions

CodeDescription
5086The endpoint application is not connected to the room.
5097cancelFloorInvite() not applicable in a chat-only room. Non-contextual method call.
5006A user with the 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 a Floor Invitation

The EnxRoom.acceptInviteFloorRequest() method allows participants to accept the floor access invitation and talk.

Class: EnxRoom

Method: (void)acceptInviteFloorRequest:(NSString* _Nonnull)clientId

Parameter: clientId: String. Client Id of the participant who has received the invitation to the floor.

Delegate Methods:

Delegate MethodDescription
didProcessFloorRequestedAcknowledgement to the participant when the participant accepts the invitation to the floor.
didAcceptedFloorInviteNotification to all the moderators in the room including the moderator who sent the floor access invitation to a participant when the participant accepts the invitation.

Sample Response

{
msg = Success;
request = {
id = processFloorRequest;
params = {
action = acceptFloor;
clientId = "18c9b8bb-142e-44a7-b30b-6701cd9e62d9";
};
};
result = 0;
}

Sample Response

{
clientId = "8ed7241c-36d9-4224-b8f3-7d015718d09e";
id = floorAccepted;
msg = "Floor accepted";
result = 1738;
}

Sample Code

//Participant accepts the invitation to Floor
[EnxRoom.acceptInviteFloorRequest:"ClientID"];
// Acknowledgment to the Participant when they accept the invitation to the Floor
- (void)didProcessFloorRequested:(NSArray *_Nullable)Data;
// Notification to all the Moderators in the Room including the one who sent the invitation
-(void)didAcceptedFloorInvite:(NSArray *_Nullable)Data;

Error Codes and Exceptions

CodeDescription
5086The endpoint application is not connected to the room.
5097acceptInviteFloorRequest() not applicable in a chat-only room. Non-contextual method call.
5006A user with the 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 a Floor Invitation

The EnxRoom.rejectInviteFloor() method allows an invited participant to reject the floor invitation.

Class: EnxRoom

Method: (void)rejectInviteFloor:(NSString* _Nonnull)clientId;

Parameter: clientId: String. Client Id of the participant who received the floor invitation.

Delegate Methods:

Delegate MethodDescription
didProcessFloorRequestedAcknowledgement to the participant when the participant rejects the floor invitation.
didRejectedInviteFloorNotification to all the moderators including the moderator who sent the floor invitation when the participant rejects the invitation.

Sample Response

{
msg = Success;
request = {
id = processFloorRequest;
params = {
action = rejectFloor;
clientId = "87184b36-26b3-4450-b908-6d9de6a457c5";
};
};
result = 0;
}

Sample Response

{
clientId = "57ab3a52-2d85-4a22-a4b4-d58b90ea84ec";
id = floorRejected;
msg = "Floor Denied";
result = 1709;
}

Sample Code

// Participant rejects invitation to Floor
[EnxRoom rejectInviteFloor:"ClientID"];
// Acknowledgment to the Participant wen they reject invitation to the Floor
-(void)didProcessFloorRequested:(NSArray *_Nullable)Data;
// Notification to the Moderators when Participant rejects invitation to the Floor
-(void)didRejectedInviteFloor:(NSArray *_Nullable)Data;

Error Codes and Exceptions

CodeDescription
5086The endpoint application is not connected to the 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 the Group mode. Non-contextual method call.