Breakout Room
The Android SDK provides the following methods for creating breakout rooms, add and disconnect 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 certain usecases where auto-assignment of users into different breakout rooms is required.
- joinBreakOutRoom(): To allow users to join a breakout room on being invited by the creator of the 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 allow the participants to clear all breakout rooms.
- destroyAllBreakOutSession(): To destroy all the breakout room sessions.
Introduction
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:
- 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: public void createBreakOutRoom(JSONObject RoomDefinition)
Parameters
Parameter | Keys | 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 screen sharing 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. |
Callback: onAckCreateBreakOutRoom
: Acknowledgment to the creator with the created breakout room returned as a JSON object.
Sample Response
{ msg: {rooms: [xxx, xxx]},result: 0}
Callback: onBreakoutRoomCreated
: Notification to all the moderators in the parent room when a breakout room is created.
Sample Response
{id = "breakout-room-created";msg = {clientId = "68d0388c-5630-4f16-883a-8bc2a138a905";roomId = 61249702a7282c251ec8d840;};},
JSONObject RoomDefinition = {"participants" :2,"audio" : true,"video": false ,"canvas": false,"share": false,"max_rooms": 1};// Create Breakout RoomenxRoom.createBreakOutRoom(RoomDefinition);// Acknowledgment to the creatorpublic void onAckCreateBreakOutRoom(JSONObject jsonObject) {// jsonObject is JSON with created Breakout Room Information}// Notification to all the Moderatorspublic void onBreakoutRoomCreated(JSONObject jsonObject);
Error Codes and Exceptions
Code | Description |
---|---|
5067 | Breakout Room not supported in 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 automatically joins the breakout room.
This method must be invoked from the parent room and not from the breakout room.
Class: EnxRoom
Method: public void inviteToBreakOutRoom(JSONObject invitee)
Parameters
Parameters | Keys | Data Type | Description |
---|---|---|---|
invitee |
invitee.clients |
Array | Array of Client IDs of users to invite. |
invitee.room_id |
String | Room ID of the breakout room to which the users are invited. | |
invitee.force_join |
Boolean | If set to true, the invited participant is forced to join the breakout room. This functionality is available in Android SDK 2.0.1 and later versions. |
Callbacks
Callback | Description |
---|---|
onAckInviteBreakOutRoom | Acknowledgment to the creator with JSON object returned as a response to the invitation process. |
onInvitationForBreakoutRoom | Notification to the invited users when they are invited to join a breakout room. |
onBreakoutRoomInvited | Notification to all the moderators in the parent room when a user is invited to a breakout room. |
didBreakoutroomjoining | Notification sent to the invited participant when the participant needs to join the breakout room. |
onBreakoutroomjoining | Notification sent to the invited particicpant when the participant is invited to join a breakout room. |
Sample Response
{"msg": "Success","result": 0,}
- Response Body:
{"result": 0,}
- Response Body:
{id = "breakout-room-invited";msg = {clientId = "12f31157-e62a-43f6-8719-f98b3da40978";roomId = 6124b82e98533871c791a788;};}
JSONObject invitee = {"clients" : [ clientId1, clientId2],"room_id" : "RoomID"};// Invite user to Breakout Room.enxRoom.inviteToBreakOutRoom(invitee);// Acknowledgment to the Creatorpublic void onAckInviteBreakOutRoom(JSONObject jsonObject) {// jsonObject is the result of invitation process, e.g.}// Notification to the invited userspublic void onInvitationForBreakoutRoom(JSONObject jsonObject) {// jsonObject carries the invitation details, e.g.}// Notification to the Moderator(s)public void onBreakoutRoomInvited(JSONObject jsonObject); {}// Notification to the Participant(s)public void didBreakoutroomjoining(JSONObject jsonObject); {}// Notification to the Participant(s)public void onBreakoutroomjoining(JSONObject jsonObject); {}
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 a breakout room with defined specifications and randomly invites users to join a breakout room depending on the capacity of the room.
Class: EnxRoom
Method: public void createAndInviteBreakoutRoom (JSONObject roomDefinition)
Parameters
Parameters | Keys | 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. |
Callback: onAckCreateAndInviteBreakOutRoom
: Acknowledgment to the creator with the result of invitation in a JSON array.
Sample Code
JSONObject RoomDefinition = {"participants" :2,"audio" : true,"video": false ,"canvas": false,"share": false,"max_rooms": 1};enxRoom.createAndInviteBreakoutRoom(RoomDefinition);public void onAckCreateAndInviteBreakOutRoom(JSONObject jsonObject) {// jsonObject is JSON with created Breakout Room Information, e.g./*{ msg: {rooms: [xxx, xxx]},result: 0|*/}
Error Codes and Exceptions
Code | Description |
---|---|
5067 | Breakout Room not supported in a Room in lecture mode |
Join a Breakout Room
The EnxRoom.joinBreakOutRoom()
method allows participants to join a breakout room on the breakout room creator's invitation. A participant can join a breakout room from the parent room only and join only one breakout room at a time, thus allowing the participant to join another breakout room only after rejoining the parent room first.
Class: EnxRoom
Method: public void joinBreakOutRoom(JSONObject Joinee, JSONObject streamInfo)
Parameters
Parameters | Keys | Data Type | Description |
---|---|---|---|
Joinee |
Joinee.role |
String | Required Enumerated Values: participant, moderator. |
Joinee.room_id |
String | Required Room-ID of the breakout room to join. | |
streamInfo |
streamInfo.audio |
Boolean | Set it to true to join the breakout room with audio. |
streamInfo.video |
Boolean | Set it to true to join the breakout room with video. This is currently not supported. |
Callbacks
Callback | Description |
---|---|
onConnectedBreakoutRoom | Acknowledgment to a participant when the a participant joins the breakout room successfully. |
onFailedJoinBreakOutRoom | Notification to a participant if the connection to the breakout room fails. |
onUserJoinedBreakoutRoom | Notification to everyone in the breakout room when a new participant joins the room. |
Sample Code
JSONObject Joinee = {"role" : "participant","room_id" : "RoomID"};JSONObject StreamInfo = {"audio" : true,"room_id" : false};enxRoom.joinBreakOutRoom(Joinee, StreamInfo);public void onConnectedBreakoutRoom(JSONObject roomMetadata) {// roomMetadata contains meta information of the Room}public void onFailedJoinBreakOutRoom(JSONObject jsonObject) {// data contains reasons for failed connection}public void onUserJoinedBreakoutRoom(EnxRoom room, JSONObject jsonObject) {// jsonObject contains new joiner's information/*{ "clientId": "String","room": "String";}*/}
Reject a Breakout Room Invitation
The EnxRoom.rejectBreakOutRoom()
allows the invited users to reject the invitation to join a breakout room.
Class: EnxRoom
Method: public void rejectBreakOutRoom(String roomId)
Parameter: roomId
: String. Identifier of the breakout room to which the user is invited.
Callback: onAckRejectBreakOutRoom
: Acknowledgment to the user who rejected the breakout room invitation when the request to reject is successfully processed.
Sample Response
{"result" : 0/1, // 0 for success and 1 for failure"msg" : "success/failure"}
Callback: onBreakoutRoomInviteRejected
: Notification to all the moderators in the parent room when a user rejects an invitation to a breakout room.
Sample Response
// User rejects Breakout room invitation.EnxRoom. rejectBreakOutRoom(" roomId");// Acknowledgment to the user when invitation rejected.public void onAckRejectBreakOutRoom(JSONObject jsonObject);// Notification to the Moderators in the Parent Room when invitation rejected.public void onBreakoutRoomInviteRejected(JSONObject jsonObject);
Pause a Parent Room
The EnxRoom.pause()
method allows the user to pause the parent room after joining the breakout room.
Class: EnxRoom
Method: public void pause()
Callback: onAckPause
: Acknowledgment to the user when the parent room is paused.
Sample Code
enxRoom.pause(); // Pause Parent Roompublic void onAckPause(JSONObject jsonObject) {// jsonObject 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 is paused while joining the breakout room.
Class: EnxRoom
Method: public void resume()
Callback: onAckResume
: Acknowledgment to the user when the parent room is resumed.
Sample Code
enxRoom.resume(); // Resume Parent Roompublic void onAckResume(JSONObject jsonObject) {// jsonObject 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 the breakout room.
Class: EnxRoom
Method: public void muteRoom(JSONObject muteInfo)
Parameters
Parameters | Keys | Data Type | Description |
---|---|---|---|
muteInfo |
muteInfo.audio |
Boolean | Set it to true to mute the audio of the parent room. |
muteInfo.video |
Boolean | Set it to true to mute the video of the parent room. |
Callback: onAckMuteRoom
: Acknowledgment to the user when the parent room is muted.
Sample Code
JSONObject MuteInfo = {"audio" : true,"video" : true};enxRoom muteRoom(MuteInfo);public void onAckMuteRoom(JSONObject jsonObject) {// jsonObject contains muting status}
Unmute a Parent Room
The EnxRoom.unmuteRoom()
is used to unmute the audio and/or video of the parent room after disconnecting from the breakout room and resuming the parent room.
Class: EnxRoom
Parameters
Parameters | Keys | Data Type | Description |
---|---|---|---|
unmuteInfo |
unmuteInfo.audio |
Boolean | Set it to true to unmute the audio of the parent room after resuming it. |
unmuteInfo.video |
Boolean | Set it to true to unmute the video of the parent room after resuming it. |
Callbacks: onAckUnmuteRoom
: Acknowledgment to the user when the parent room is unmuted.
Sample Code
JSONObject UnmuteInfo = {"audio" : true,"video" : true};enxRoom UnmuteRoom(UnmuteInfo);public void onAckUnmuteRoom(JSONObject jsonObject) {// jsonObject contains muting status}
Disconnect from a Breakout Room
The EnxRoom.disconnect()
method allows the user to disconnect from the breakout room.
Class: EnxRoom
Method: public void disconnect()
Callbacks
Callback | Description |
---|---|
onDisconnectedBreakoutRoom | Acknowledgment to a particicpant when the participant is successfully disconnected from the breakout room. |
onUserDisconnectedFromBreakoutRoom | Notification to everyone in the breakout room when a participant is disconnected from the room. |
Sample Code
enxRoom.disconnect();public void onDisconnectedBreakoutRoom(JSONObject jsonObject) {// jsonObject carries info related to disconnection/*{ "moderatorId": "String","msg": "Breakout Room disconnected","result": 0}*/};public void onUserDisconnectedFromBreakoutRoom(EnxRoom room,JSONObject jsonObject) {// jsonObject carries info related to disconnected user/*{ "clientId": "String","name": "String","room": "breakout-Development"}*/};
Clear All Breakout Rooms
This functionality is only available in Android SDK 2.0.1 and later versions.
The EnxRoom.clearAllBreakOutSession()
method allows participants to clear all breakout rooms. The participants are disconnected from all breakout instances and rejoined with the parent room.
Class: EnxRoom
Method: EnxRoom.clearAllBreakOutSession()
Event Listener: onDisconnectedBreakoutRoom
: Notification to the moderator/owner of the breakout room with information about the disconnected participant.
Sample Code
public void onDisconnectedBreakoutRoom(JSONObject jsonObject) {// JSON Object carries disconnected participants information/*{ "room_id": "String"}*/}
Handle Destroyed Breakout Rooms
This functionality is available in Android SDK 2.0.1 and later versions.
The EnxRoom.destroyAllBreakOutSession()
method allows the moderator to destroy all the breakout room sessions. When all the breakout room sessions are destroyed, the parent room is automatically resumed and unmuted for the particicpants.
Class: EnxRoom
Method: EnxRoom.destroyAllBreakOutSession()
Event Listener: onDisconnectedBreakoutRoom
: Notification to the owner when the breakout room is destroyed.
Sample Code
public void onDisconnectedBreakoutRoom(JSONObject jsonObject) {// JSON Object carries destroyed room information/*{ "room_id": "String"}*/}