Breakout Rooms

Breakout rooms allow participants to split out of the main session for side discussions without leaving the video session entirely. Users in a breakout room are treated as "paused" in the parent room until they return.

Creating Breakout Rooms

Create a Breakout Room

EnxRoom.createBreakOutRoom(JSONObject RoomDefinition) provisions one or more empty breakout room slots on the server. No participants are assigned at this stage — invitation is a separate step. Each created room receives a unique ID used when inviting participants.

Parameter Type Description
RoomDefinition.participants Numeric Required. Total participants (min 2, max = parent room max_active_talkers - 1)
RoomDefinition.audio Boolean Required. Set true to enable audio
RoomDefinition.video Boolean Required. Set true to enable video (currently not supported)
RoomDefinition.canvas Boolean Required. Set true to enable canvas streaming
RoomDefinition.share Boolean Required. Set true to enable screen sharing
RoomDefinition.max_rooms Numeric Required. Number of breakout rooms to create
Callback Description
onAckCreateBreakOutRoom Acknowledgment to the creator with the created room info as JSON
onBreakoutRoomCreated Notification to all moderators in the parent room when a breakout room is created
JSONObject roomDefinition = new JSONObject();
roomDefinition.put("participants", 2);
roomDefinition.put("audio", true);
roomDefinition.put("video", false);
roomDefinition.put("canvas", false);
roomDefinition.put("share", false);
roomDefinition.put("max_rooms", 1);

enxRoom.createBreakOutRoom(roomDefinition);

public void onAckCreateBreakOutRoom(JSONObject jsonObject) {
    // Creator: breakout room created
    // jsonObject: { msg: { rooms: [xxx] }, result: 0 }
}

public void onBreakoutRoomCreated(JSONObject jsonObject) {
    // All moderators notified
}
Error code 5067 is returned if you attempt to create a breakout room while in Lecture Mode. Verify the room is in Group Mode before calling this method.

Create and Auto-Invite

EnxRoom.createAndInviteBreakoutRoom(JSONObject roomDefinition) combines room creation and participant assignment into a single step. EnableX automatically distributes participants across the created breakout rooms based on capacity — useful when you want to auto-group a large session without managing individual invitations.

The roomDefinition object uses the same parameters as createBreakOutRoom() — see the parameter table above.

Callback Description
onAckCreateAndInviteBreakOutRoom Acknowledgment to the creator with result in JSON array
enxRoom.createAndInviteBreakoutRoom(roomDefinition);

public void onAckCreateAndInviteBreakOutRoom(JSONObject jsonObject) {
    // Creator: rooms created and users assigned
}
Error code 5067 applies here as well. This method is not available in Lecture Mode rooms.
Inviting Users

Invite Users to a Breakout Room

EnxRoom.inviteToBreakOutRoom(JSONObject invitee) invites specific participants into a chosen breakout room by client ID. This method must be called from the parent room, not from within a breakout room.

By default, participants receive an invitation they can accept or reject. Set force_join to true to move participants immediately without requiring acceptance (SDK v2.0.1+).

Parameter Type Description
invitee.clients Array Array of Client IDs of users to invite
invitee.room_id String Room ID of the breakout room
invitee.force_join Boolean If true, invitee is auto-joined without needing to accept (SDK v2.0.1+)
Callback Description
onAckInviteBreakOutRoom Acknowledgment to the creator with the invitation result
onInvitationForBreakoutRoom Notification to the invited users
onBreakoutRoomInvited Notification to all moderators in the parent room
didBreakoutroomjoining Notification to the invited participant when connected to the breakout room
JSONObject invitee = new JSONObject();
JSONArray clients = new JSONArray();
clients.put("clientId1");
invitee.put("clients", clients);
invitee.put("room_id", "BREAKOUT_ROOM_ID");

enxRoom.inviteToBreakOutRoom(invitee);

public void onAckInviteBreakOutRoom(JSONObject jsonObject) {
    // Invitation sent
}

public void onInvitationForBreakoutRoom(JSONObject jsonObject) {
    // Invited user notified
}

public void onBreakoutRoomInvited(JSONObject jsonObject) {
    // Moderators notified
}
Joining and Rejecting

Join a Breakout Room

EnxRoom.joinBreakOutRoom(JSONObject Joinee, JSONObject streamInfo) is called by an invited participant to accept and enter a breakout room. The SDK establishes a new session in the breakout room while pausing the participant's presence in the parent room. A participant can only be in one breakout room at a time and can only join from the parent room.

Parameter Type Description
Joinee.role String "participant" or "moderator"
Joinee.room_id String Room ID of the breakout room
streamInfo.audio Boolean true to join with audio
streamInfo.video Boolean true to join with video (not currently supported)
Callback Description
onConnectedBreakoutRoom Acknowledgment to the joiner when successfully connected
onFailedJoinBreakOutRoom Notification to the joiner when connection fails
onUserJoinedBreakoutRoom Notification to everyone in the breakout room when a new participant joins
JSONObject joinee = new JSONObject();
joinee.put("role", "participant");
joinee.put("room_id", "BREAKOUT_ROOM_ID");

JSONObject streamInfo = new JSONObject();
streamInfo.put("audio", true);
streamInfo.put("video", false);

enxRoom.joinBreakOutRoom(joinee, streamInfo);

public void onConnectedBreakoutRoom(JSONObject roomMetadata) {
    // Joined breakout room
}

public void onFailedJoinBreakOutRoom(JSONObject jsonObject) {
    // Join failed
}

public void onUserJoinedBreakoutRoom(EnxRoom room, JSONObject jsonObject) {
    // New participant joined
}

Reject a Breakout Room Invitation

EnxRoom.rejectBreakOutRoom(String roomId) declines a breakout room invitation. Pass the room ID received in the onInvitationForBreakoutRoom callback. The moderator is notified so they can take action if needed.

Callback Description
onAckRejectBreakOutRoom Acknowledgment to the user when rejection is processed
onBreakoutRoomInviteRejected Notification to all moderators when an invitation is rejected
enxRoom.rejectBreakOutRoom("BREAKOUT_ROOM_ID");

public void onAckRejectBreakOutRoom(JSONObject jsonObject) {
    // Rejection acknowledged
}

public void onBreakoutRoomInviteRejected(JSONObject jsonObject) {
    // Moderators notified
}
Parent Room Control

While active inside a breakout room, a participant still has a presence in the parent room shown as "paused". Your app can explicitly control that parent room presence — pausing, resuming, or muting/unmuting its audio and video independently. This is useful for managing bandwidth or for explicit session control.

Pause the Parent Room

EnxRoom.pause() pauses the parent room audio and video while the user is active in a breakout room.

Callback Description
onAckPause Acknowledgment when paused
enxRoom.pause();

public void onAckPause(JSONObject jsonObject) {
    // Parent room paused
    // { "msg": "Room muted", "result": 0 }
}

Resume the Parent Room

EnxRoom.resume() lifts the pause on the parent room, restoring the participant's presence stream.

Callback Description
onAckResume Acknowledgment when resumed
enxRoom.resume();

public void onAckResume(JSONObject jsonObject) {
    // Parent room resumed
}

Mute the Parent Room

EnxRoom.muteRoom(JSONObject muteInfo) independently mutes audio and/or video in the parent room. This lets you, for example, mute audio while keeping video active.

Parameter Type Description
muteInfo.audio Boolean Set true to mute audio in the parent room
muteInfo.video Boolean Set true to mute video in the parent room
Callback Description
onAckMuteRoom Acknowledgment when the parent room is muted
JSONObject muteInfo = new JSONObject();
muteInfo.put("audio", true);
muteInfo.put("video", true);
enxRoom.muteRoom(muteInfo);

public void onAckMuteRoom(JSONObject jsonObject) {
    // Parent room muted
}

Unmute the Parent Room

EnxRoom.unmuteRoom(JSONObject unmuteInfo) restores audio and/or video in the parent room.

Callback Description
onAckUnmuteRoom Acknowledgment when the parent room is unmuted
JSONObject unmuteInfo = new JSONObject();
unmuteInfo.put("audio", true);
unmuteInfo.put("video", true);
enxRoom.unmuteRoom(unmuteInfo);

public void onAckUnmuteRoom(JSONObject jsonObject) {
    // Parent room unmuted
}
Disconnect and Destroy

Disconnect from a Breakout Room

EnxRoom.disconnect() ends the participant's breakout room session. The user is automatically returned to the parent room and their parent room stream resumes.

Callback Description
onDisconnectedBreakoutRoom Acknowledgment when successfully disconnected
onUserDisconnectedFromBreakoutRoom Notification to everyone remaining in the breakout room
enxRoom.disconnect();

public void onDisconnectedBreakoutRoom(JSONObject jsonObject) {
    // { "moderatorId": "", "msg": "Breakout Room disconnected", "result": 0 }
}

public void onUserDisconnectedFromBreakoutRoom(EnxRoom room, JSONObject jsonObject) {
    // { "clientId": "String", "name": "String", "room": "..." }
}

Clear All Breakout Rooms

Available in Android SDK 2.0.1 and later.

EnxRoom.clearAllBreakOutSession() disconnects all participants from all active breakout instances and returns them to the parent room. The breakout room slots are cleared but not permanently destroyed. Each affected participant receives the onDisconnectedBreakoutRoom callback.

enxRoom.clearAllBreakOutSession();

public void onDisconnectedBreakoutRoom(JSONObject jsonObject) {
    // { "room_id": "String" }
}

Destroy All Breakout Rooms

Available in Android SDK 2.0.1 and later.

EnxRoom.destroyAllBreakOutSession() permanently destroys all breakout room sessions. All participants inside any breakout room are disconnected. The parent room is automatically resumed and unmuted for all participants. Each breakout room owner receives the onDisconnectedBreakoutRoom callback.

Call destroyAllBreakOutSession() when the main session is about to end to ensure no participants are left stranded in a breakout room after the parent room closes.
enxRoom.destroyAllBreakOutSession();

public void onDisconnectedBreakoutRoom(JSONObject jsonObject) {
    // { "room_id": "String" }
}