A user connected to an EnableX session with a “Moderator” role has additional privileges over that of a user with a “Participant” role for the session. The Moderator exercises their privileges for moderating the session by invoking exclusive methods designed to work from their endpoint only, known as Moderator Controls.

Table of Contents

Record Session

You can record an RTC session as individual streams and also get it transcoded through a post-session service to create a single composite video file that can be retrieved and replayed using any Video Player. You can configure the Room for auto-recording or invoke APIs to start recording when required.

For details on fetching recorded sessions, refer to How to fetch Recordings?

Auto Recording

You can configure a Room with { settings: { auto_recording: true }} during Room Creation to automatically start recording the RTC session taking place in the Room. The Moderator can still stop recording in a Room with Auto-Recording by utilizing the stopRecord() method given below.

On-Demand Recording

The EnxRoom.startRecord() method allows the Moderator to start recording the session and EnxRoom.stopRecord() method is used to stop recording. You might need to provide these options on UI for the Moderator to access them.

There is no limit to the number of times a Moderator can start/stop recording.

Class: EnxRoom

Methods:

  • - (void)startRecord – No parameter required.
  • - (void)stopRecord – No parameter required.

Delegate Methods:

  • - startRecordingEvent: – Acknowledgment to the Moderator when recording starts.
  • - stopRecoedingEvent: – Acknowledgment to the Moderator when recording stops.
  • - roomRecordOn: – Notification to all the participants when the recording is turned on.
  • - roomRecordOn: – Notification to all the participants when the recording is turned off.
[room startRecord]; // To start recording

// To all participants that recording has started
-(void)roomRecordOn:(NSArray*)Data{
	/* Data is 
	[	{
			"msg":"Room Recording On",
			"result":"0"
		},
		"<null>"
	]
	*/
}

// To acknowledge the moderator that recording has started
-(void)startRecordingEvent:(NSArray *)response{
	/* response is 
	[	{
			"result":0,
			"msg":"Success"
		},
		"<null>"
	]
	*/
}


[room stopRecord]; // To stop recording

// To all participants that recording has stopped
 -(void)roomRecordOff:(NSArray*)Data{
	/*Data is 
	[	{
			"msg":"Room Recording Off",
			"result":"0"
		},
		"<null>"
	]
	*/
}

// To acknowledge the moderator that recording has stopped
-(void)stopRecordingEvent:(NSArray *)response{
	/* response is 
	[	{
			"result":0,
			"msg":"Success"
		},
		"<null>"
	]
	*/
}

Error Codes & Exceptions

CodeDescription
5007Unauthorized Access. When a participant tries to invoke startRecord().
5008Unauthorized Access. When a participant tries to invoke stopRecord().
5033Repeated startRecord() call while the previous request is in process.
5034Repeated startRecord() call while the recording has already started.
5035Repeated stopRecord() call while the previous request is in process.
5036stopRecord() call without starting to record. Non-Contextual method call.

Note: In case of error, <null> is received at 1st Index, and Error Info at 2nd Index.

Hard Mute / Unmute Room

The EnxRoom.muteAllUser() method allows the Moderator to hard-mute the Room where all the participants are muted. A new participant joining a Room in a hard-mute state would also be muted by default. The right to unmute a hard-mute Room lies only with the Moderator and participants cannot unmute their Local Streams either. The EnxRoom.unMuteAllUser() method is used to put the Room off a hard-mute state.

Class: EnxRoom

Methods:

  • - (void)muteAllUser; – No Parameter required.
  • - (void)unMuteAllUser; – No Parameter required.

Delegate Methods:

  • – didHardMutedAll: – Notification to all the participants in the Room when Room is hard-muted.
  • – didHardUnMuteAllUser: – Notification to all the participants in the Room when Room is put off hard- mute state.
  • – didMutedAllUser:– Acknowledgment to the Moderator when Room is hard-muted.
  • – didUnMutedAllUser: – Acknowledgment to the Moderator when Room is put off hard-mute state.
[room muteAllUser]; // To hard-mute Room
[room unMuteAllUser]; // To hard-unmute Room

- (void) didMutedAllUser:(NSArray *Data){
 // You hard-muted Room
}

- (void) didUnMutedAllUser:(NSArray *Data){
 // You hard-unuted Room
}

- (void)didHardMutedAll:(NSArray *Data){
 // Room is hard-muted - to all
} 

- (void)didHardUnMuteAllUser:(NSArray *Data){
 // Room is hard-unmuted - to all
}

Error Codes / Exceptions

CodeDescription
5001Unauthorized Access. When a user with a participant role invokes muteAllUser().
5002Unauthorized Access. When a user with a participant role invokes unMuteAllUser().
5037Repeated muteAllUser() request while the previous request is in process.
5038Invalid muteAllUser() request While the Room is already in a hard-mute state.
5039Invalid unMuteAllUser() request while the Room is NOT in a hard-mute state.
5040Repeated unMuteAllUser() request while the previous request is in process.

Hard Mute / Unmute Participant

The EnxStream.hardMuteAudio() and EnxStream.hardMuteVideo() methods allow the Moderator to hard-mute a Participant’s Audio and Video Streams respectively. The affected Participant cannot unmute their Audio or Video Streams. The Moderator can unmute the Participant’s Audio or Video Streams using EnxStream.hardUnMuteAudio() and EnxStream.hardUnMuteVideo() methods respectively.

Class: EnxStream

Methods:

  • - (void)hardMuteAudio:(NSString *)clientId – No Parameter required.
  • - (void)hardMuteVideo:(NSString *)clientId – No Parameter required.
  • - (void)hardUnMuteAudio:(NSString *)clientId – No Parameter required.
  • - (void)hardUnMuteVideo:(NSString *)clientId – No Parameter required.

Delegate Methods:

  • - didReceiveHardMutedAudio – Notification to the affected participant when their Audio is hard-muted.
  • - didReceiveHardUnmutedAudio – Notification to the affected participant when their Audio is lifted off the hard-mute state.
  • - didReceiveHardMutedVideo – Notification to the affected participant when their Video is hard-muted.
  • - didReceiveHardUnmutedVideo – Notification to the affected participant when their Video is lifted off the hard-mute state.
  • - didHardMuteAudio – Acknowledgment to the Moderator when a user’s Audio is hard-muted.
  • - didHardUnMuteAudio – Acknowledgment to the Moderator when a user’s Audio is lifted off the hard-mute state.
  • didHardMuteVideo – Acknowledgment to the Moderator when a user’s Video is hard-muted.
  • - didHardUnMuteVideo – Acknowledgment to the Moderator when a user’s Video is lifted off the hard-mute state.
[stream hardMuteAudio:@”clientId”];	// To hard-mute user's audio

-(void)didReceiveHardMutedAudio:(NSArray *)Data{
	// Your audio is hard-muted
}
-(void)didHardMuteAudio:(NSArray *)Data{
	// You hard-muted the user's audio
}

[stream hardUnMuteAudio:@”clientId”];	//To hard un-mute user's audio
-(void)didReceivedHardUnmutedAudio:(NSArray *)Data{
	// Your audio is hard-unmuted
}

-(void)didHardUnMuteAudio:(NSArray *)Data{
	// You hard-unmuted user's audio
}

// Video Hard-Mute/Hard-Unmute will be used in the same way as Audio.  

Error Codes / Exceptions

CodeDescription
5009Unauthorized Access. When a user with a participant role invokes hardMuteAudio().
5010Unauthorized Access. When a user with a participant role invokes hardUnMuteAudio().
5011Unauthorized Access. When a user with a participant role invokes hardMuteVideo().
5012Unauthorized Access. When a user with a participant role invokes hardUnMuteVideo().

Lock / Unlock Room

The EnxRoom.lockRoom() method allows the Moderator to lock the Room which forbids any new user from joining the Session. The Moderator can unlock the Room using EnxRoom.unlockRoom() method to allow subsequent users to join the Session.

ClassEnxRoom

Methods:

  • - (void)lockRoom; – No Parameter required.
  • - (void)unlockRoom; – No Parameter required.

Delegate Methods:

  • – room:didAckLockRoom: – Acknowledgment to the Moderator when the Room is locked.
  • – room:didLockRoom: – Notification to all the participants in the Room when the room is locked.
  • – room:didAckUnlockRoom: – Acknowledgment to the Moderator when the Room is unlocked.
  • – room:didUnlockRoom: – Notification to all the participants in the Room when the room is unlocked.
[room lockRoom];

// Moderator is acknowledged that room has been locked 
- (void)room:(EnxRoom *_Nullable)room didAckLockRoom:(NSArray *_Nullable)data;

// Participants are notified that room has been locked
- (void)room:(EnxRoom *_Nullable)room didLockRoom:(NSArray *_Nullable)data;

 
[room unlockRoom];

// Moderator is acknowledged that room has been unlocked 
- (void)room:(EnxRoom *_Nullable)room didAckUnlockRoom:(NSArray *_Nullable)data;

// Participants are notified that room has been unlocked
- (void)room:(EnxRoom *_Nullable)room didUnlockRoom:(NSArray *_Nullable)data;

Error Codes / Exceptions

CodeDescription
5115Unauthorized Access. When a user with participant role invokes lockRoom() or unlockRoom().
5117Invalid request. When the Moderator invokes lockRoom() on a locked Room.
5118Invalid request. When the Moderator invokes unlockRoom() on an unlocked Room.

Disconnect User

The EnxRoom.dropUser() method allows the Moderator to disconnect/force-drop one or more participant(s) from the Session.

Method: -(void)dropUser:(NSArray *_Nonnull)clientIds;

Parameter:

  • clientIds: Required. Array of Client IDs to be disconnected.

Delegate Methods:

  • -room:didAckDropUser: Acknowledgment to the Moderator when the user is disconnected.
  • -room:didRoomDisconnected: Notification to the affected user with the reason to be disconnected from the Room.
[room dropUser:@[clientIds]];

// Acknowledgment that the user is dropped
(void)room:(EnxRoom *_Nullable)room didAckDropUser:(NSArray *_Nullable)data; 

Error Codes / Exceptions

CodeDescription
5116Unauthorized Access. When a user with participant role invokes dropUser()

Destroy Session

The EnxRoom.destroy() method allows the Moderator to conclude an ongoing session.

Method: -(void)destroy; – No Parameter required.

Delegate Methods:

  • -room:didAckDestroy: – Acknowledgment to the Moderator when the session is destroyed.
  • -room:didRoomDisconnected: – Notification to all users in the Room when the session is destroyed.
[room destroy];

// Acknowledgement to Moderator that the session is destroyed
 (void)room:(EnxRoom *_Nullable)room didAckDestroy:(NSArray *_Nullable)data; 

Error Codes / Exceptions

CodeDescription
5116Unauthorized Access. When a user with participant role invokes destroy().

Moderate Participant’s entry to a Session

In a knock-enabled Room, a user needs to wait until the Moderator grants them permission to join the Session. The EnxRoom.approveAwaitedUser() method allows the Moderator to approve a user’s entry and EnxRoom.denyAwaitedUser() method is used to decline a user’s entry to the Session.

Methods:

  • -approveAwaitedUser:clientID
  • -denyAwaitedUser: clientID

Parameters:

  • clientID: Client ID of the user awaiting the Moderator’s approval.

Delegate Methods:

  • - room:diduserAwaited – Notification to the Moderator when a user awaits their permission to join Room.
  • - room:didRoomAwaited – Notification to the user when they await Moderator’s permission to connect Room with { “event_type”: “knock” } in the JSON Payload.
  • - room:didAckForApproveAwaitedUser – Acknowledgment to the Moderator when the user is granted permission to join Room.
  • - room:didConnect – Notification to the user when the user is permitted to join Room.
  • - room:didAckForDenyAwaitedUser – Acknowledgment to the Moderator when the user is denied permission to join Room.
  • - room:didRoomDisconnect – Notification to the user along with a reason for denial when the user is denied access to the Room.
// Moderator is notified about awaited user
-(void)room:(EnxRoom *_Nullable)room diduserAwaited:(NSArray *_Nullable)data  {
	// Awaited Client Info in the data, e.g.
	// [{"id","String", "name": "String”}] 
	
	[room approveAwaitedUser:id];  // To allow

	[room denyAwaitedUser:id]; // To deny
	 
};

-(void)room:(EnxRoom *_Nullable)room didAckForApproveAwaitedUser:(NSArray *_Nullable)data; 
{	// User has been allowed entry	
}

-(void)room:(EnxRoom *_Nullable)room didAckForDenyAwaitedUser:(NSArray *_Nullable)data {
	// User has been denied entry	
}

To manage awaited users when moderator joins late

If the Moderator joins after the participant(s) have sent a request to join the Session in a Knock-enabled Room, then the Moderator can get the list of participants awaiting approval using room.awaitedParticipants. You can utilize this attribute to build UI for Moderator controls to handle pending approvals.

// e.g. room.awaitedParticipants

[
	{	"clientId”: "String", 
		"name": "String" 
	}
]

Floor Access Control in Lecture Mode

In Lecture Mode, only the Moderator can publish a stream in the Room and the participants can only subscribe to the Moderator’s stream. If a participant(s) wants to publish their Stream during the session, they need to request the Moderator for Floor Access.

The Floor Access Controls are implemented using the following APIs:

Request Floor Access

The EnxRoom.requestFloor() method allows a Participant to request the Moderator for Floor Access.

Class: EnxRoom

Method: - (void)requestFloor; – No parameter required.

Delegate Method:

- didFloorRequestReceived: – Notification to the Moderator when a Participant’s access request is received.

[room requestFloor];
 -(void)didFloorRequestReceived:(NSArray )Data{     
 
/*Data is 
      [   {
              "clientId": "XXXX", // Who requested
              "name": "iOS" 
          },
          "<null>"
      ]
      */
  }
CodeDescription
5003Unauthorized Access. When a user with a Moderator role invokes requestFloor().
5041Repeated requestFloor() call while 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 group mode. Non-Contextual method call.

Note: In case of error, <null> is received at the first Index, and Error Info at the second Index.

Cancel Requested Floor Access

The Enxroom.cancelFloor() method allows participants to cancel their request for Floor Access pending for Moderator’s approval.

ClassEnxRoom

Method: - (void)cancelFloor; – No Parameter required.

Delegate Method

  • - room:didCancelledFloorRequest: Notification to the Moderator when the participant cancels the Floor Access Request.
  • room:didFloorCancelled: Acknowledgment to the Participant when their Floor Access Request is canceled.
[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 / Exceptions

CodeDescription
5003Unauthorized Access. When 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 error, <null> is received at the first Index and Error Info at the second Index.

Deny Floor Access

The EnxRoom.denyFloor() method allows the Moderator to deny a Participant’s request for Floor Access.

ClassEnxRoom

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

Parameter:

clientId – Client ID of the Participant requesting Floor Access.

Delegate Method

  • - didDeniedFloorRequest: – Notification to the Participant when the Floor Access has been denied.
  • - didProcessFloorRequested: – Acknowledgment to the Moderator when the Floor Access has been denied.
[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 / Exceptions

CodeDescription
5005Unauthorized Access. When a user with participant role invokes 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 group mode. Non-Contextual method call.

Note: In case of error, <null> is received at the first Index and Error Info at the second Index.

Grant Floor Access

The EnxRoom.grantFloor() method allows the Moderator to grant Floor Access to one or more Participants one by one. Note that at any given point in time, only one Participant can be granted floor access. To grant Floor Access to others, the Moderator must release Floor Access from the existing participant.

Class: EnxRoom

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

Delegate Method:

  • - didGrantedFloorRequest: – Notification to the Participant when Floor Access is received.
  • - didProcessFloorRequested: – Acknowledgment to the Moderator when Participant is granted Floor Access.
[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 & Exceptions

CodeDescription
5004Unauthorized Access. When a user with participant role invokes grantFloor().
5045When Invalid 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 Access from the existing Participant.
5069Unable to grant Floor Access when Floor Release is in process.
5067Unable to process the request for a Room in group mode. Non-Contextual method call.

Note: In case of error, <null> is received at the first Index and Error Info at the second Index.

Finish Floor Access

The EnxRoom.finishFloor() allows the Participant to announce the completion of Floor Access and release Floor Access.

Class: EnxRoom

Method: - (void)finishFloor; – No Parameter required.

Delegate Method

  • - room:didFinishedFloorRequest: Notification to the Moderator when the Participant finishes Floor Access.
  • – room:didFloorFinished: Acknowledgment to the Participant when Floor Access is finished.
[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 / Exceptions

CodeDescription
5003Unauthorized Access. When a user with moderator role invokes finishFloor().
5041Repeated finishFloor() call while the previous request is in process.
5042When 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 error, <null> is received at the first Index and Error Info at the second Index.

Release Floor Access

The Enxroom.releaseFloor() method allows the Moderator to terminate the Floor Access granted to a Participant. This unpublishes the participant’s streams and makes the Floor available for access again.

Class: EnxRoom

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

Parameter:

clientId – Client ID of the Participant whose Floor Access is being released.

Delegate Method:

  • - didReleasedFloorRequest: – Notification to the Participant when their Floor Access is revoked.
  • - didProcessFloorRequested: – Acknowledgment to the Moderator when the Floor Access is released.
[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 / Exceptions:

CodeDescription
5006Unauthorized Access. When a user with participant role invokes releaseFloor()
5045Invalid Client ID passed to releaseFloor().
5049Repeated releaseFloor() call while 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 error, <null> is received at the first Index and Error Info at the second Index.

Restore Moderator Session

If the Moderator gets disconnected during a session, the list of Floor Access Requests and participants currently with Floor Access can be retrieved via the Room-Meta-Data when the Moderator gets 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 lecture mode, where only the Moderator can speak and control speakers in the Room through Floor Access Control methods, the Invite to Floor methods provide more options to the Moderator to organize a conference in lecture mode.

Invite Participant to Floor

The EnxRoom.inviteToFloor() method allows the Moderator to invite any Participant in the 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:

  • didACKInviteToFloorRequested – Acknowledgment to the Moderator when an invitation to Floor is sent to the Participant.

Response Body:

{
   msg = Success; 
   result = 0;
} 
  • didInviteToFloorRequested – Notification to all the Moderators in the Room when an invitation to Floor is sent to the Participant.

Response Body:

{
    clientId = "cae0afbc-fb94-4743-8c04-ae48e9d3eb52"; 
    id = inviteToFloor; 
    name = Jay;
} 
  • didInvitedForFloorAccess – Notification to the invited Participant when an invitation to Floor is received.

Response Body:

{  
        clientId = "9554a040-58bd-4f0b-a010-7f92c54b2918"; 
        id = inviteToFloor; 
        moderator = "e2b48879-3754-49f2-bf86-08a73347e408"; 
        name = Jay; 
 } 
// 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 & Exceptions:

CodeDescription
5086 Endpoint application is not connected to a Room. 
5097inviteToFloor() is not applicable in a Chat-Only Room. Non-Contextual method call.
5006A User with a 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 Invitation to Floor

The EnxRoom.cancelFloorInvite() method allows the Moderator to cancel a Floor Invitation sent to a Participant.

Class: EnxRoom

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

Parameter:

clientId – Client Id of the Participant whose invitation needs to be canceled.

Callback:

  • didProcessFloorRequested – Acknowledgment to the Moderator when Cancel Invitation request is sent to the Participant.

Response Body:

{ 
     msg = Success; 
     request =  { 

        id = processFloorRequest; 
 	params =  { 

            action = cancelFloorInvite;
            clientId = "cae0afbc-fb94-4743-8c04-ae48e9d3eb52"; 
       		}; 
	}; 
    	result = 0; 
} 
  • didCanceledFloorInvite – Notification to the invited Participant and other Moderators in the Room when invitation is canceled by the Moderator.

Response Body for the Participant:

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

Response Body for other Moderators:

{ 
        clientId = "ade30ef1-595d-4364-b4f5-1d9420f24b0f"; 
        id = cancelFloorInvite; 
        name = JayiOS; 
} 
// 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 & Exceptions:

CodeDescription
5086 Endpoint application is not connected to a Room. 
5097cancelFloorInvite() not applicable in a Chat-Only Room. Non-Contextual method call.
5006A User with a 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 Invitation to Floor

The EnxRoom.acceptInviteFloorRequest() method allows the Participant to accept the invitation to the Floor and talk.

Class: EnxRoom

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

Parameter:

clientId – Client Id of the Participant who has received the invitation to the Floor.

Delegate Methods:

  • didProcessFloorRequested – Acknowledgment to the Participant when they accept the invitation to the Floor.

Response Body:

{ 
    msg = Success; 
    request =     { 
        id = processFloorRequest; 
        params =  { 
            action = acceptFloor; 
            clientId = "18c9b8bb-142e-44a7-b30b-6701cd9e62d9"; 
        }; 
    }; 
    result = 0;
} 
  • didAcceptedFloorInvite – Notification to all the Moderators in the Room including the one who sent the invitation when the Participant accepts invitation.

Response Body:

{ 
        clientId = "8ed7241c-36d9-4224-b8f3-7d015718d09e"; 
        id = floorAccepted; 
        msg = "Floor accepted"; 
        result = 1738; 
}
//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 & Exceptions:

CodeDescription
5086 Endpoint application is not connected to a Room. 
5097acceptInviteFloorRequest() not applicable in a Chat-Only Room. Non-Contextual method call.
5006A User with a 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 Invitation to Floor

The EnxRoom.rejectInviteFloor() method allows the invited Participant to reject the invitation to the Floor.

Class: EnxRoom

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

Parameter:

clientId – Client Id of the Participant who has received the invitation to the Floor.

Delegate Methods:

  • didProcessFloorRequested – Acknowledgment to the Participant when they reject the invitation to Floor.

Response Body:

{ 
    msg = Success; 
    request =     { 
        id = processFloorRequest; 
        params =  { 
            action = rejectFloor; 
            clientId = "87184b36-26b3-4450-b908-6d9de6a457c5"; 
        }; 
    }; 
    result = 0; 
} 
  • didRejectedInviteFloor – Notification to all the Moderators including the one who sent the invitation when the Participant rejects the invitation.

Response Body:

{ 
        clientId = "57ab3a52-2d85-4a22-a4b4-d58b90ea84ec"; 
        id = floorRejected; 
        msg = "Floor Denied"; 
        result = 1709; 
} 
// 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 & Exceptions:

CodeDescription
5086 Endpoint application is not connected to a 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 group mode. Non-Contextual method call.

Change Participant’s Role

The EnxRoom.switchUserRole() method allows the Moderator to promote a Participant to act as a Moderator in the ongoing Session. This newly appointed Moderator gets access to Moderator Controls and the former Moderator becomes a Participant in the Session. The new Moderator can further grant the Moderator role to another participant if so desired.

Class: EnxRoom

Method: - (void)switchUserRole:(NSString *)clientId;

Parameter:

clientId – Client ID of the participant who is being designated as Moderator.

Delegate Methods:

  • - room:didSwitchUserRole: – Acknowledgment to the Moderator when a Switch User Role is requested.
  • - room:didUserRoleChanged: – Notification to the new Moderator when their role is changed from Participant to Moderator.
// Switching user with ClientId to Moderator Role
[_remoteRoom switchUserRole:@"clientId"];	

- (void)room:(EnxRoom *)room didSwitchUserRole:(NSArray *)data {
	// Modeator is acknowledged 
}

- (void)room:(EnxRoom *)room didUserRoleChanged:(NSArray *)data {
	// New Modeator is notified that 
	// his role is promoted to Moderator
}

Error Codes / Exceptions:

CodeDescription
5085Unauthorized Access. When a user with participant role invokes switchUserRole()

Start / Stop Live Streaming

The EnxRoom.startStreaming() method allows the Moderator to forward live Video Sessions over RTMP Stream to any live streaming CDNs supporting this protocol. The EnxRoom.stopStreaming() method is used to stop forwarding RTMP Stream.

ClassEnxRoom

Methods:

  • -(void)startStreaming:(NSDictionary *_Nonnull)streamingConfig;
  • -(void)stopStreaming:(NSDictionary *_Nonnull)streamingConfig; 

Parameters:

  • streamingConfig – Configuration options for forwarding streams
    • rtmpDetails.rtmpUrl – Use “RTM-URL/RTMP-KEY” from CDN Provider
    • rtmpDetails.urlDetails.url – Optional RTMP Streaming View URL. If not given, a default Streaming View will be applied.

Delegate Methods:

  • - room:didAckStartStreaming: – Acknowledgment to the Moderator when RTMP Streaming starts.
  • - room:didAckStopStreaming: – Acknowledgment to the Moderator when RTMP Streaming starts.
  • - room:didStreamingNotification: – Notification to all the Participants in the Room when RTMP Streaming starts/stops.
//Start Live Streaming
 
-(void)startStreaming:(NSDictionary *_Nonnull)streamingConfig;
 
NSDictionary *StemInfo = @{@"rtmpDetails": :@{@"rtmpUrl":@"rtmp://a.rtmp.youtube.com/live2/4rjb-hprf-7wf5-9923"}, :@"urlDetails":@{@"url":@"https://meeting-qa.enablex.io/room/?token="}}
 
[EnxRoom startStreaming: StemInfo];

// Stop Live Streaming
 
-(void)stopStreaming:(NSDictionary *_Nonnull)streamingConfig;
 
NSDictionary *StemInfo = @{@"rtmpDetails": :@{@"rtmpUrl":@"rtmp://a.rtmp.youtube.com/live2/4rjb-hprf-7wf5-9923"}, :@"urlDetails":@{@"url":@"https://meeting-qa.enablex.io/room/?token="}}
 
[EnxRoom stopStreaming: StemInfo];

Error Codes / Exceptions

CodeDescription
5121Repeated startStreaming() call while the previous request is in process.
5122Repeated startStreaming() call after Streaming has started.
5123Repeated stopStreaming() call while the previous request is in process.
5124stopStreaming() called without starting a Stream first. Non-Contextual Method Call.
5125Invalid Stream configuration.

Pin User Stream(s)

The EnxRoom.pinUsers() method allows the Moderator to pin a user(s) to the Active Talker List irrespective of the user’s activity level. A pinned user’s Stream is always published in the Room even if they are not talking. The inactive pinned users are placed in the Active Talker List after the actively talking users in a descending order based on the activity level with the most active talker on top. The total number of pinned users in a Room is restricted to (max_active_talkers – 1) based on the Room configuration.

On joining a Room, the user is notified via -room:didConnect: event with Room Meta Information, which contains the list of pinned users as "pinnedUsers": [ /*client-ids*/ ].

The EnxRoom.unpinUsers() method is used to unpin the user(s).

Methods:

  • -(void)pinUsers:(NSArray *_Nonnull)clientIds
  • -(void)unpinUsers:(NSArray *_Nonnull)clientIds 

Parameters:

  • clientIds– Array of Client IDs of users whose streams need to be pinned or unpinned.

Delegate Methods:

  • - room:didAckPinUsers – Acknowledgment to the Moderator when the users are pinned.
  • - room:didAckUnpinUsers – Acknowledgment to the Moderator when the users are unpinned.
  • - room:didPinnedUsers: Notification to everyone in the Room with an updated list of pinned users.
[enxRoom pinUsers:[clientID1, clientID2]];	// Pin Users
[enxRoom unpinUsers:[clientID1, clientID2]];// Unpin Users

-(void)room:(EnxRoom *_Nullable)channel didAckPinUsers:(NSArray *_Nullable)data{
	// Acknowledges that Users are pinned
}

-(void)room:(EnxRoom *_Nullable)channel didAckUnpinUsers:(NSArray *_Nullable)data{
	// Acknowledges that Users are unpinned
}

-(void)room:(EnxRoom *_Nullable)channel didPinnedUsers:(NSArray *_Nullable)data{
	// Notifies with updated pinned user list
}

Error Codes / Exceptions

CodeDescription
5003Unauthorized Access. When a user with participant role invokes pinUser() or unpinUser().
5126Invalid client IDs passed.

Spotlight

The EnxRoom.addSpotlightUsers() method allows the Moderator to spotlight a user which pushes the user’s Stream to the top of Active Talker List irrespective of the user’s activity level. Spotlighting publishes the chosen user’s Stream in the Room even if they are not talking. The Moderator can spotlight as many users as max_active_talkers defined in the Room Configuration.

On joining a Room, the user is notified via onRoomConnected event with Room Meta Information, which contains the list of spotlightUsers.

Further active talkers list JSON received with didActiveTalkersUpdated callback has “spotlight” key with boolean value. Spotlighted users have spotlight: true in the list.

The EnxRoom.removeSpotlightUsers() method is used to remove the spotlight from user(s) Streams.

Class: EnxRoom

Methods:

  • -(void)addSpotlightUsers:(NSArray *_Nonnull)clientIds 
  • -(void)removeSpotlightUsers:(NSArray *_Nonnull)clientIds  

Parameters:

  • clientIds– Array of Client IDs of users whose streams are spotlighted or removed from the spotlight.

Delegate Methods:

  • -room:didAckAddSpotlightUsers – Acknowledgment to the Moderator when spotlight request is received with the following JSON { "result": 0, clients: [] }:
    • result: 0 for success.
    • clients: Array of Client IDs being added.
  • -room:didAckRemoveSpotlightUsers – Acknowledgment to the Moderator when spotlight removal request is received with the following JSON { "result": 0, clients: [] }:
    • result: 0 for success.
    • clients: Array of Client IDs being added.
  • -room:didUpdatedSpotlightUsers – Notification to everyone in the Room when the spotlighted user list update is received with the following JSON { "moderator_id": String, clients: [] }:
    • moderator_id: Moderator’s Id who updates the spotlight user list.
    • clients: Array of Client IDs of users who are spotlighted.
[enxRoom addSpotlightUsers:[clientID1, clientID2]];	// To add Spotlight
[enxRoom removeSpotlightUsers:[clientID1, clientID2]];	// To remove from Spotlight

-(void)room:(EnxRoom *_Nullable)channel didAckAddSpotlightUsers:(NSArray *_Nullable)data {
	// Moderator who adds users to Spotlight is acknowledged
	// data { "result": 0,  clients: [] }
}

-(void)room:(EnxRoom *_Nullable)channel didAckRemoveSpotlightUsers:(NSArray *_Nullable)data {
	// Moderator who removes users from Spotlight is acknowledged 
	// data { "result": 0,  clients: [] }
}

- (void)room:(EnxRoom *_Nullable)channel didUpdatedSpotlightUsers:(NSArray *_Nullable)data {
	// Everyone is notified wtih updated Spotlight list
	// data { "moderator_id": "String",  clients: [] }
}

Explore Android Toolkit