Breakout Rooms·续1
You can also listen to stateUpdate event to get the latest list of breakout rooms & participants, as they are updated in real-time.
meeting.connectedMeetings.on("stateUpdate", ({meetings, parentMeeting}) => {
console.log("stateUpdate", {meetings, parentMeeting});
// Alternatively, you can access the meetings and parentMeeting from the connectedMeetings object
console.log("Meetings List", meeting.connectedMeetings.meetings);
console.log("Parent Meeting", meeting.connectedMeetings.parentMeeting);
});
const breakoutRoomsInfo = await meeting.connectedMeetings.getConnectedMeetings();
breakoutRoomsInfo is an object containing the list of breakout rooms and their participants, along with details of the parent meeting.
This data can be used to display the list of breakout rooms & participants in the UI. This API refetches the list of breakout rooms & participants, therefore can be considered the source of truth for breakout rooms & participants. It is advised to call this API, to get the latest list of breakout rooms & participants, if a lot of changes are in progress.
You can also listen to stateUpdate event to get the latest list of breakout rooms & participants, as they are updated in real-time.
meeting.connectedMeetings.on("stateUpdate", ({meetings, parentMeeting}) => {
console.log("stateUpdate", {meetings, parentMeeting});
// Alternatively, you can access the meetings and parentMeeting from the connectedMeetings object
console.log("Meetings List", meeting.connectedMeetings.meetings);
console.log("Parent Meeting", meeting.connectedMeetings.parentMeeting);
});
const breakoutRooms = await meeting.connectedMeetings.createMeetings([
{ title: "Breakout Room 1" },
{ title: "Breakout Room 2" },
{ title: "Breakout Room 3" },
]);
console.log("Created Breakout Rooms: ", breakoutRooms.map((room) => "Id:: " + room.id + " --- Title:: " + room.title).join("\n"));
breakoutRooms is an array of basic meeting information such as id and title. You can use the id of these objects to move participants to the breakout room.
meeting.connectedMeetings.getConnectedMeetings { result ->
result.onSuccess { breakoutRoomsInfo ->
println("Parent Meeting: ${breakoutRoomsInfo.parentMeeting}")
println("Breakout Rooms: ${breakoutRoomsInfo.meetings}")
}.onFailure { error ->
println("Failed to fetch breakout rooms: ${error.value.message}")
}
}
breakoutRoomsInfo is an object containing the list of breakout rooms and their participants, along with details of the parent meeting.
This data can be used to display the list of breakout rooms and participants in the UI. This API refetches the list of breakout rooms and participants, and can therefore be considered the source of truth. It is advised to call this API to get the latest state if a lot of changes are in progress.
You can also listen to the onStateUpdate event to receive real-time updates to the list of breakout rooms and participants.
meeting.addConnectedMeetingsEventListener(object : RtkConnectedMeetingsEventListener {
override fun onStateUpdate(meetings: List<RtkConnectedMeeting>, parentMeeting: RtkConnectedMeeting?) {
println("State updated. Meetings: $meetings, Parent: $parentMeeting")
// Alternatively, access state directly from the connectedMeetings object
println("Meetings List: ${meeting.connectedMeetings.meetings}")
println("Parent Meeting: ${meeting.connectedMeetings.parentMeeting}")
}
override fun onChangingMeeting(meetingId: String) {}
override fun onMeetingChanged(error: MeetingError?) {}
})
meeting.connectedMeetings.getConnectedMeetings { result in
switch result {
case .success(let breakoutRoomsInfo):
print("Parent Meeting: \(String(describing: breakoutRoomsInfo.parentMeeting))")
print("Breakout Rooms: \(breakoutRoomsInfo.meetings)")
case .failure(let error):
print("Failed to fetch breakout rooms: \(error.value.message)")
}
}
breakoutRoomsInfo is an object containing the list of breakout rooms and their participants, along with details of the parent meeting.
This data can be used to display the list of breakout rooms and participants in the UI. This API refetches the list of breakout rooms and participants, and can therefore be considered the source of truth. It is advised to call this API to get the latest state if a lot of changes are in progress.
You can also listen to the onStateUpdate event to receive real-time updates to the list of breakout rooms and participants.
class MyListener: RtkConnectedMeetingsEventListener {
func onStateUpdate(meetings: [RtkConnectedMeeting], parentMeeting: RtkConnectedMeeting?) {
print("State updated. Meetings: \(meetings), Parent: \(String(describing: parentMeeting))")
// Alternatively, access state directly from the connectedMeetings object
print("Meetings List: \(meeting.connectedMeetings.meetings)")
print("Parent Meeting: \(String(describing: meeting.connectedMeetings.parentMeeting))")
}
func onChangingMeeting(meetingId: String) {}
func onMeetingChanged(error: MeetingError?) {}
}
meeting.addConnectedMeetingsEventListener(MyListener())
const breakoutRoomsInfo = await meeting.connectedMeetings.getConnectedMeetings();
breakoutRoomsInfo is an object containing the list of breakout rooms and their participants, along with details of the parent meeting.
This data can be used to display the list of breakout rooms & participants in the UI. This API refetches the list of breakout rooms & participants, therefore can be considered the source of truth for breakout rooms & participants. It is advised to call this API, to get the latest list of breakout rooms & participants, if a lot of changes are in progress.
You can also listen to stateUpdate event to get the latest list of breakout rooms & participants, as they are updated in real-time.
meeting.connectedMeetings.on("stateUpdate", ({meetings, parentMeeting}) => {
console.log("stateUpdate", {meetings, parentMeeting});
// Alternatively, you can access the meetings and parentMeeting from the connectedMeetings object
console.log("Meetings List", meeting.connectedMeetings.meetings);
console.log("Parent Meeting", meeting.connectedMeetings.parentMeeting);
});
Move participants to breakout rooms
Once you have created breakout rooms, assign participants to the rooms.
// Retrieve list of breakout rooms & participants
const breakoutRoomsInfo = await meeting.connectedMeetings.getConnectedMeetings();
/*
* You can retrieve meetingIds and participantIds from the breakoutRoomsInfo object.
* Based on where the participant currently is, you can decide the sourceMeetingId and targetMeetingId.
*/
// Move participants to breakout rooms
const response = await meeting.connectedMeetings.moveParticipants(
"SOURCE_MEETING_ID", // sourceMeetingId, meeting id where participants are currently in
"TARGET_MEETING_ID", // targetMeetingId, meeting id where participants are to be moved
["PARTICIPANT_ID_1", "PARTICIPANT_ID_2"], // participantIds, array of participant ids to be moved
);
// Retrieve list of breakout rooms & participants
const breakoutRoomsInfo = await meeting.connectedMeetings.getConnectedMeetings();
/*
* You can retrieve meetingIds and participantIds from the breakoutRoomsInfo object.
* Based on where the participant currently is, you can decide the sourceMeetingId and targetMeetingId.
*/
// Move participants to breakout rooms
const response = await meeting.connectedMeetings.moveParticipants(
"SOURCE_MEETING_ID", // sourceMeetingId, meeting id where participants are currently in
"TARGET_MEETING_ID", // targetMeetingId, meeting id where participants are to be moved
["PARTICIPANT_ID_1", "PARTICIPANT_ID_2"], // participantIds, array of participant ids to be moved
);
// Retrieve list of breakout rooms & participants
const breakoutRoomsInfo = await meeting.connectedMeetings.getConnectedMeetings();
/*
* You can retrieve meetingIds and participantIds from the breakoutRoomsInfo object.
* Based on where the participant currently is, you can decide the sourceMeetingId and targetMeetingId.
*/
// Move participants to breakout rooms
const response = await meeting.connectedMeetings.moveParticipants(
"SOURCE_MEETING_ID", // sourceMeetingId, meeting id where participants are currently in
"TARGET_MEETING_ID", // targetMeetingId, meeting id where participants are to be moved
["PARTICIPANT_ID_1", "PARTICIPANT_ID_2"], // participantIds, array of participant ids to be moved
);
// Retrieve list of breakout rooms & participants
meeting.connectedMeetings.getConnectedMeetings { result ->
result.onSuccess { breakoutRoomsInfo ->
/*
* You can retrieve meetingIds and participantIds from breakoutRoomsInfo.
* Based on where the participant currently is, decide the sourceMeetingId and targetMeetingId.
*/
// Move participants to a breakout room
meeting.connectedMeetings.moveParticipants(
sourceMeetingId = "SOURCE_MEETING_ID",
destinationMeetingId = "TARGET_MEETING_ID",
participantIds = listOf("PARTICIPANT_ID_1", "PARTICIPANT_ID_2")
) { error ->
if (error != null) {
println("Failed to move participants: $error")
} else {
println("Participants moved successfully")
}
}
}
}
// Retrieve list of breakout rooms & participants
meeting.connectedMeetings.getConnectedMeetings { result in
switch result {
case .success(let breakoutRoomsInfo):
/*
* You can retrieve meetingIds and participantIds from breakoutRoomsInfo.
* Based on where the participant currently is, decide the fromMeetingId and toMeetingId.
*/
// Move participants to a breakout room
meeting.connectedMeetings.moveParticipants(
sourceMeetingId: "SOURCE_MEETING_ID",
destinationMeetingId: "TARGET_MEETING_ID",
participantIds: ["PARTICIPANT_ID_1", "PARTICIPANT_ID_2"]
) { error in
if let error = error {
print("Failed to move participants: \(error)")
} else {
print("Participants moved successfully")
}
}
case .failure(let error):
print("Failed to fetch breakout rooms: \(error.value.message)")
}
}
// Retrieve list of breakout rooms & participants
const breakoutRoomsInfo = await meeting.connectedMeetings.getConnectedMeetings();
/*
* You can retrieve meetingIds and participantIds from the breakoutRoomsInfo object.
* Based on where the participant currently is, you can decide the sourceMeetingId and targetMeetingId.
*/
// Move participants to breakout rooms
const response = await meeting.connectedMeetings.moveParticipants(
"SOURCE_MEETING_ID", // sourceMeetingId, meeting id where participants are currently in
"TARGET_MEETING_ID", // targetMeetingId, meeting id where participants are to be moved
["PARTICIPANT_ID_1", "PARTICIPANT_ID_2"], // participantIds, array of participant ids to be moved
);
Move participants, with a specific preset, to breakout rooms
Once you have created breakout rooms, assign participants to the rooms.
const response = await meeting.connectedMeetings.moveParticipantsWithCustomPreset(
"SOURCE_MEETING_ID", // sourceMeetingId, meeting id where participants are currently in
"TARGET_MEETING_ID", // targetMeetingId, meeting id where participants are to be moved
[{ presetId: "PRESET_ID_1" }, { presetId: "PRESET_ID_2" }], // array of objects with presetId field
);
const response = await meeting.connectedMeetings.moveParticipantsWithCustomPreset(
"SOURCE_MEETING_ID", // sourceMeetingId, meeting id where participants are currently in
"TARGET_MEETING_ID", // targetMeetingId, meeting id where participants are to be moved
[{ presetId: "PRESET_ID_1" }, { presetId: "PRESET_ID_2" }], // array of objects with presetId field
);
const response = await meeting.connectedMeetings.moveParticipantsWithCustomPreset(
"SOURCE_MEETING_ID", // sourceMeetingId, meeting id where participants are currently in
"TARGET_MEETING_ID", // targetMeetingId, meeting id where participants are to be moved
[{ presetId: "PRESET_ID_1" }, { presetId: "PRESET_ID_2" }], // array of objects with presetId field
);
meeting.connectedMeetings.moveParticipantsWithCustomPreset(
sourceMeetingId = "SOURCE_MEETING_ID",
destinationMeetingId = "TARGET_MEETING_ID",
participants = listOf(
MoveParticipantPayload(id = "PARTICIPANT_ID_1", presetId = "PRESET_ID_1"),
MoveParticipantPayload(id = "PARTICIPANT_ID_2", presetId = "PRESET_ID_2")
)
) { error ->
if (error != null) {
println("Failed to move participants: $error")
} else {
println("Participants moved with custom preset successfully")
}
}
meeting.connectedMeetings.moveParticipantsWithCustomPreset(
sourceMeetingId: "SOURCE_MEETING_ID",
destinationMeetingId: "TARGET_MEETING_ID",
participants: [
MoveParticipantPayload(id: "PARTICIPANT_ID_1", presetId: "PRESET_ID_1"),
MoveParticipantPayload(id: "PARTICIPANT_ID_2", presetId: "PRESET_ID_2")
]
) { error in
if let error = error {
print("Failed to move participants: \(error)")
} else {
print("Participants moved with custom preset successfully")
}
}
