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
room?.setEnxBreakoutRoomObserver(myBreakoutObserver)

val opts = JSONObject().apply {
    put("numberOfRooms", 2)
    put("duration", 15) // minutes
}
room?.createBreakoutRoom(opts)

override fun onAckCreateBreakOutRoom(jsonObject: JSONObject?) { }
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
room?.setEnxBreakoutRoomObserver(myBreakoutObserver)

val opts = JSONObject().apply {
    put("numberOfRooms", 2)
    put("duration", 15) // minutes
}
room?.createBreakoutRoom(opts)

override fun onAckCreateBreakOutRoom(jsonObject: JSONObject?) { }
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
val inviteOpts = JSONObject().apply {
    put("roomId", breakoutRoomId)
    put("clientIds", JSONArray().put(clientId1).put(clientId2))
}
room?.inviteToBreakoutRoom(inviteOpts)
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
override fun onInvitationForBreakoutRoom(jsonObject: JSONObject?) {
    // Participant received invite — show dialog then join
    room?.joinBreakoutRoom(jsonObject!!)
}

override fun onConnectedBreakoutRoom(enxRoom: EnxRoom?, jsonObject: JSONObject?) {
    // Use enxRoom for all room operations in breakout
}

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
room?.rejectBreakoutRoomInvite()

override fun onAckRejectBreakOutRoom(jsonObject: JSONObject?) { }
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
room?.pause()

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
room?.resume()

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
val muteInfo = JSONObject().apply {
    put("audio", true)
    put("video", true)
}
room?.muteRoom(muteInfo)

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
val unmuteInfo = JSONObject().apply {
    put("audio", true)
    put("video", true)
}
room?.unmuteRoom(unmuteInfo)
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
room?.leaveBreakoutRoom()

override fun onDisconnectedBreakoutRoom(jsonObject: JSONObject?) { }

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.

room?.broadcastToRoom("Hello from main room!")

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.
room?.destroyBreakoutRoom()

override fun onDestroyedBreakoutRoom(jsonObject: JSONObject?) { }