Breakout Room
The iOS SDK provides the following methods for creating breakout rooms, adding and disconnecting participants to breakout rooms, and other related tasks:
- createBreakOutRoom(): To create a breakout room.
- inviteToBreakOutRoom(): To invite one or more users to a breakout room from the parent room.
- createAndInviteBreakoutRoom(): To support use-cases where auto-assignment of users into different breakout rooms is required.
- joinBreakOutRoom(): To join a breakout room.
- rejectBreakOutRoom(): To reject the invitation to join a breakout room.
- pause(): To pause the parent room.
- resume(): To resume the parent room.
- muteRoom(): To mute audio and/or video of the parent room.
- unmuteRoom(): To unmute audio and/or video of the parent room.
- disconnect(): To disconnect from a breakout room.
- clearAllBreakOutSession(): To clear all breakout rooms.
- destroyAllBreakOutSession(): To destroy all the breakout room sessions.
What is Breakout Room?
Breakout rooms allow users to participate in a discussion outside the main video room, that is, the parent room.
The process of breaking out takes place in the following manner: *The A creator or owner of a breakout room invites one or more users from the parent room to the breakout room.
- The invited users are notified about the request and need to accept the request to join the breakout room.
- Users moving out of the parent room are treated as "paused" users in the parent room until they return.
Review the following considerations before implementing a breakout room:
- A breakout room is available only in the Group Mode room, not in the Lecture mode.
- A breakout room can only be created by a user from the parent room. A user cannot create another breakout room while being within a breakout room.
- A breakout room can be created with a limit to the maximum number of allowed participants, which must be less than the maximum number of Active Talkers in the parent room.
- A breakout room supports only audio calls with screen sharing and canvas streaming features.
- A maximum of 10 breakout rooms are allowed for a parent room.
Create a Breakout Room
The EnxRoom.createBreakOutRoom()
method creates a breakout room.
Class: EnxRoom
Method: -(void)createBreakOutRoom:(NSDictionary* _Nonnull) RoomDefinition;
Parameters
Parameter | Key | Data Type | Description |
---|---|---|---|
RoomDefinition |
RoomDefinition.participants |
Numeric | Required. Total number of participants in a breakout room. The minimum number of participants in a breakout room is 2. The maximum number of participants in a breakout room is max_active_talkers of the parent room is 1. |
RoomDefinition.audio |
Boolean | Required. Set it to true to enable audio communication in a breakout room. | |
RoomDefinition.video |
Boolean | Required. Set it to true to enable video communication in a breakout room. (This is currently not supported). | |
RoomDefinition.canvas |
Boolean | Required. Set it to true to enable canvas streaming in a breakout room. | |
RoomDefinition.share |
Boolean | Required. Set it to true to enable screen sharing in a breakout room. | |
RoomDefinition.max_rooms |
Numeric | Required. The total number of breakout rooms to create. |
Delegate Methods
Delegate Method | Description |
---|---|
-room:didAckCreateBreakOutRoom |
To obtain the result of the created breakout rooms as a JSON array. |
-room:didBreakoutRoomCreated |
Notification to all the moderators in the parent room when a breakout room is created. |
Sample Request
{ msg: {rooms: [xxx, xxx]},result: 0}
Sample Response
{id = "breakout-room-created";msg = {clientId = "68d0388c-5630-4f16-883a-8bc2a138a905";roomId = 61249702a7282c251ec8d840;};},
NSDictionary *dict = @{@"participants" :@2,@"audio" : @true,@"video": @false ,@"canvas":@false,@"share":@false,@"max_rooms":@1};// Create Breakout Room[EnxRoom createBreakOutRoom:dict];// Acknowledgment to the creator- (void)room:(EnxRoom *_Nullable)room didAckCreateBreakOutRoom:(NSArray *_Nullable)data {// data in JSON with created breakout Room Information.}// Notification to all the Moderators- (void)room:(EnxRoom *_Nullable)room didBreakoutRoomCreated:(NSArray *_Nullable)data;
Error Codes and Exceptions
Code | Description |
---|---|
5067 | Breakout room not supported for a room in Lecture-mode. |
Invite Users to Join a Breakout Room
The EnxRoom.inviteToBreakOutRoom()
method allows the creator or owner of a breakout room to invite one or more users from the parent room to join the breakout room. If the force_join
feature is enabled, the invitee is automatically admitted to the breakout room.
This method must be invoked from the parent room and and from the breakout room.
Class: EnxRoom
Method: -(void)inviteToBreakOutRoom:(NSDictionary * _Nonnull) Invitee;
Parameters
Parameter | Key | Data Type | Description |
---|---|---|---|
Invitee |
Invitee.clients |
Array | Array of Client IDs of users to invite to a breakout room. |
Invitee.room_id |
String | Room ID of the breakout room to which the users are being invited to. | |
Invitee.force_join |
Boolean | If set to true, the invited participant are forced to join the breakout room. This feature is available in iOS SDK 2.0.1 and later versions. |
Delegate Methods
Delegate Method | Description |
---|---|
-room:didAckInviteBreakOutRoom |
Acknowledgment to the creator of the breakout room with a JSON object returned as a response to the invitation process. |
-room:didInvitationForBreakoutRoom |
Notification to the invited users when they are invited to join a breakout room. |
-room:didBreakoutRoomInvited |
Notification to all the moderators in the parent room when a user is invited to a breakout room. |
-room:didBreakoutroomjoining |
Notification sent to the invited participant when the participant is connected to the breakout room. |
Sample Response
{"msg": "Success","result": 0,}
Sample Response
{"result": 0,}
Sample Response
{id = "breakout-room-invited";msg = {clientId = "12f31157-e62a-43f6-8719-f98b3da40978";roomId = 6124b82e98533871c791a788;};}
Sample Code
NSDictionary *invitee = @{@"clients" : [ clientId1, clientId2],@"room_id" : @"RoomID"};// Invite user to breakout Room.[EnxRoom inviteToBreakOutRoom:invitee];// Acknowledgment to the Creator- (void)room:(EnxRoom *_Nullable)room didAckInviteBreakOutRoom:(NSArray *_Nullable)data {// data is the result of invitation process, e.g.}// Notification to the invited users- (void)room:(EnxRoom *_Nullable)room didInvitationForBreakoutRoom:(NSArray *_Nullable)data {// data carries the invitation details, e.g.}// Notification to the Moderator(s)- (void)room:(EnxRoom *_Nullable)room didBreakoutRoomInvited:(NSArray *_Nullable)data; {}// Notification to the Participant(s)- (void)room:(EnxRoom *_Nullable)room didBreakoutroomjoining:(NSArray *_Nullable)data; {}// Notification to the Participant(s)- (void)room:(EnxRoom *_Nullable)room onBreakoutroomjoining:(NSArray *_Nullable)data; {}
Create a Breakout Room and Auto-Invite the Users to the Room
The EnxRoom.createAndInviteBreakoutRoom()
is used to support certain use-cases where auto-assignment of users into different breakout rooms is required. This method creates breakout rooms with given specifications and invites users to join these rooms randomly depending on the capacity of each room.
Class: EnxRoom
Method: -(void)createAndInviteBreakoutRoom:(NSDictionary* _Nonnull) RoomDefinition;
Parameters
Parameter | Data Type | Description |
---|---|---|
RoomDefinition | JSON Object | Dictionary with room definition parameters. |
-room:didAckCreateAndInviteBreakOutRoom | JSON Object | Acknowledgment to the creator of a breakout room with the result of invitation in a JSON array. |
Sample Code
NSDictionary *dict = @{@"participants" :@2,@"audio" : @true,@"video": @false ,@"canvas":@false,@"share":@false,@"max_rooms":@2};[EnxRoom createAndInviteBreakoutRoom:dict];- (void)room:(EnxRoom *_Nullable)room didAckCreateAndInviteBreakOutRoom:(NSArray *_Nullable)data {// data is JSON with created breakout Room Information, e.g./*[{ msg: {rooms: [xxx, xxx]},result: 0|]*/}
Error Codes and Exceptions
Code | Description |
---|---|
5067 | Breakout room creation is not supported for a room in Lecture mode. |
Join a Breakout Room
The EnxRoom.joinBreakOutRoom()
method allows users to join a breakout room on breakout room creator's invitation. A user can join a breakout room from the parent room only and join only one breakout room at a time. A user can join another breakout room only after rejoining the parent room.
Class: EnxRoom
Method: -(void)joinBreakOutRoom:(NSDictionary* _Nonnull)Joinee withStreamInfo:(NSDictionary* _Nullable)streamInfo;
Parameters
Parameter | Key | Data Type | Description |
---|---|---|---|
Joinee |
Joinee.role |
String | Required Enumerated Values: participant, moderator |
Joinee.room_id |
String | Required Room-ID of the breakout room being joined. | |
streamInfo |
streamInfo.audio |
Boolean | Set it to true to join with audio. |
streamInfo.video |
Boolean | Set it to true to join with video. This is currently not supported. |
Delegate Methods
Delegate Method | Description |
---|---|
- room:didConnectedBreakoutRoom |
Acknowledgment to the joiner on joining the breakout room successfully. |
- room:didFailedJoinBreakOutRoom |
Notification to the joiner on failing to join the breakout room. |
- room:didUserJoinedBreakoutRoom |
Notification to everyone in a breakout room when a new user joins the room. |
Sample Code
NSDictionary *Joinee = @{@"role" : @"participant",@"room_id" : @"RoomID"};NSDictionary *StreamInfo = @{@"audio" : @true,@"room_id" : @false};[EnxRoom joinBreakOutRoom:Joinee StreamInfo];- (void)room:(EnxRoom *_Nullable)room didConnectedBreakoutRoom:(NSDictionary *_Nullable)roomMetadata {// roomMetadata contains meta information of the Room}- (void)room:(EnxRoom *_Nullable)room didFailedJoinBreakOutRoom:(NSArray *_Nullable)data {// data contains reasons of failed connection}- (void)room:(EnxRoom *_Nullable)room didUserJoinedBreakoutRoom:(NSArray *_Nullable)data {// data contains new joinee user's information/*{ "clientId": "String","room": "String";}*/}
Reject a Breakout Room Invitation
The EnxRoom.rejectBreakOutRoom()
allows the invited user to reject the invitation to join a breakout Room.
Class: EnxRoom
Method: -(void)rejectBreakOutRoom:(NSString *_Nonnull)roomId
Parameter: roomId
: String. The breakout Room identifier to which the user is invited.
Delegate Methods
Delegate Method | Description |
---|---|
-room:didAckRejectBreakoutRoom | Acknowledgment to the user who rejected the invitation when the request to reject is successfully processed. |
didBreakoutRoomInviteRejected | Notification to all the moderators in the parent room when a user rejects an invitation to a breakout room. |
Sample Response
{"result" : 0/1, // 0 for success and 1 for failure"msg" : "success/failure"}
Sample Code
// User rejects breakout room invitation.[EnxRoom rejectBreakOutRoom:@"RoomID"];// Acknowledgment to the user when invitation rejected.- (void)room:(EnxRoom *_Nullable)room didAckRejectBreakoutRoom:(NSArray *_Nullable)data;// Notification to the Moderators in the Parent Room when invitation rejected.- (void)room:(EnxRoom *_Nullable)room didBreakoutRoomInviteRejected:(NSArray *_Nullable)data
Pause a Parent Room
The EnxRoom.pause()
method allows users to pause the parent room after joining a breakout room.
Class: EnxRoom
Method: - (void) pause
Delegate Method: - room:didAckPause
: Acknowledgment to the user when the parent room is paused.
Sample Code
[EnxRoom pause]; // Pause Parent Room- (void)room:(EnxRoom *_Nullable)room didAckPause:(NSArray *_Nullable)data{// data carries info related to pausing/*{ "msg": "Room muted","result": 0}*/};
Resume a Parent Room
The EnxRoom.resume()
method is used to resume the parent room if it was paused when joining the breakout room.
Class: EnxRoom
Method: - (void) resume
Delegate Method: - room:didAckResume
: Acknowledgment to the user when the parent room is resumed.
Sample Code
[EnxRoom resume]; // Resume Parent Room- (void)room:(EnxRoom *_Nullable)room didAckResume:(NSArray *_Nullable)data {// data carries info related to resume/*{ "msg": "Room unmuted","result": 0}*/};
Mute a Parent Room
The EnxRoom.muteRoom()
method allows users to mute audio and/or video of the parent room after joining a breakout room.
Class: EnxRoom
Method: -(void)muteRoom:(NSDictionary * _Nonnull)muteInfo
Parameters
Parameter | Key | Data Type | Description |
---|---|---|---|
mutetInfo |
audio |
Boolean | Set it to true mute the audio. |
video |
Boolean | Set it to true to mute the video. |
Delegate Method: - room:didAckMuteRoom
: Acknowledgment to the user when the parent room is muted.
Sample Code
NSDictionary *MuteInfo = @{@"audio" : @true,@"video" : @true};[EnxRoom muteRoom:MuteInfo];- (void)room:(EnxRoom *_Nullable)room didAckMuteRoom:(NSArray *_Nullable)data {// data contains muting status}
Unmute a Parent Room
The EnxRoom.unmuteRoom()
is used to unmute audio and/or video of the parent room when it is resumed after disconnecting from a breakout room.
Class: EnxRoom
Method: -(void)unmuteRoom:(NSDictionary * _Nonnull)unmuteInfo
Parameters
Parameter | Key | Data Type | Description |
---|---|---|---|
UnmuteInfo |
audio |
Boolean | Set it to true to unmute the audio. |
video |
Boolean | Set it to true to unmute the video. |
Delegate Method: - room:didAckUnmuteRoom
: Acknowledgment to the user when the parent room is unmuted.
Sample Code
NSDictionary *UnmuteInfo = @{@"audio" : @true,@"video" : @true};[EnxRoom unmuteRoom:UnmuteInfo];- (void)room:(EnxRoom *_Nullable)room didAckUnmuteRoom:(NSArray *_Nullable)data {// data contains unmuting status}
Disconnect from a Breakout Room
The EnxRoom.disconnect()
method allows users to disconnect from a breakout room. A user is automatically admitted to the parent room after disconnecting from a breakout room.
Class: EnxRoom
Method: - (void)disconnect
Delegate Methods:
Delegate Method | Description |
---|---|
-room:didDisconnectedBreakoutRoom | Acknowledgment to the user when successfully disconnected from a breakout room. |
-room:didUserDisconnectedFromBreakoutRoom | Notification to everyone in the breakout room when a user is disconnected from the room. |
Sample Code
[EnxRoom disconnect];- (void)room:(EnxRoom *_Nullable)room didDisconnectedBreakoutRoom:(NSArray *_Nullable) data {// data carries info related to disconnection/*{ "moderatorId": "","msg": "Breakout Room disconnected","result": 0}*/};- (void)room:(EnxRoom *_Nullable)room didUserDisconnectedFromBreakoutRoom:(NSArray *_Nullable) data {// data carries info related to disconnected user/*{ "clientId": "String","name": "String","room": "breakout-Development"}*/};
Clear All Breakout Rooms
This functionality is available in iOS SDK 2.0.1 and later versions.
The EnxRoom.clearAllBreakOutSession()
method allows a participant to clear all breakout rooms. The participant is disconnected from all breakout instances and admitted to the parent room.
Class: EnxRoom
Method: EnxRoom.clearAllBreakOutSession()
Event Listener: didDisconnectedBreakoutRoom
: Notification to the moderator or owner of the breakout room with information about the disconnected participant.
Sample Code
- (void)room:(EnxRoom *_Nullable)room didDisconnectededBreakoutRoom:(NSArray *_Nullable)data {// data carries disconnected breakoutroom information/*{ "room_id": "String"}*/}
Handle Destroyed Breakout Rooms
When all the participants of a breakout room are disconnected, the breakout room is automatically destroyed, and the creator of the room is notified with a callback.
Delegate Method: -room:didDestroyedBreakoutRoom
: Notification to the owner of a breakout room when the breakout room is destroyed.
Sample Code
- (void)room:(EnxRoom *_Nullable)room didDestroyedBreakoutRoom:(NSArray *_Nullable)data {// data carries destroyed room infomration/*{ "room_id": "String"}*/}
Handle All Destroyed Breakout Rooms
This functionality is available in iOS SDK 2.0.1 and later versions.
The EnxRoom.destroyAllBreakOutSession()
method allows moderators to destroy all the breakout room sessions. When all the breakout room sessions are destroyed, the participants of those sessions are disconnected and automatically admitted to the parent room. The parent room is resumed and unmuted.
Class: EnxRoom
Method: EnxRoom.destroyAllBreakOutSession()
Event Listener: didDisconnectedBreakoutRoom: Notification to the owner of a breakout room when the breakout room is destroyed.
Sample Code
- (void)room:(EnxRoom *_Nullable)room didDisconnectedBreakoutRoom:(NSArray *_Nullable)data {// data carries disconnected room information/*{ "room_id": "String"}*/}