Participants Events
All Participants Events
You can subscribe to events for all participants by implementing RtkParticipantsEventListener interface and then passing that object to
meeting.addParticipantsEventListener(rtkParticipantsEventListener) method.
Here are the available callbacks for the participants events:
Participant joined
The onParticipantJoin() callback is triggered whenever a new remote participant successfully joins the meeting.
It provides an RtkRemoteParticipant object, representing the new participant.
class ParticipantsEventListener extends RtkParticipantsEventListener {
...
void onParticipantJoin(RtkRemoteParticipant participant) {
// your code here to handle new participant
}
...
}
Participant left
The onParticipantLeave() callback is triggered whenever a remote participant leaves the meeting.
It provides an RtkRemoteParticipant object, representing the participant who has left.
class ParticipantsEventListener extends RtkParticipantsEventListener {
...
void onParticipantLeave(RtkRemoteParticipant participant) {
// your code here to handle participant who left
}
...
}
Active Participants changed
The onActiveParticipantsChanged() callback is triggered when the set of remote participants who should be displayed on the Grid changes.
The maximum number of participants in this active list is determined by the Grid size configured in the local user's preset.
The active list updates in two main scenarios:
- Speaking Activity: When participants start or stop speaking. The SDK prioritizes prominent audio, so an off-grid participant might replace one currently on the grid if their audio becomes more "active".
- Pagination: When local user paginates through the grid, the active list updates to reflect the participants that should be visible on that specific page.
class ParticipantsEventListener extends RtkParticipantsEventListener {
...
void onActiveParticipantsChanged(List<RtkRemoteParticipant> active) {
// your code here to update the on-screen participants (grid)
}
...
}
Active Speaker changed
The onActiveSpeakerChanged() callback is triggered whenever the primary active speaker in the meeting changes. The active speaker is the remote participant with the most prominent audio activity at any given moment.
This callback provides an RtkRemoteParticipant object representing the new active speaker. It will be null if no remote participant is currently speaking, or if the previous active speaker stops speaking.
class ParticipantsEventListener extends RtkParticipantsEventListener {
...
void onActiveSpeakerChanged(RtkRemoteParticipant? participant) {
// your code here to handle active speaker change
}
...
}
Video update
The onVideoUpdate() callback is triggered when a participant enables or disables their video.
It provides the RtkRemoteParticipant object of the participant and their new video state (isEnabled).
class ParticipantsEventListener extends RtkParticipantsEventListener {
...
void onVideoUpdate(RtkRemoteParticipant participant, bool isEnabled, ) {
// your code here to handle participant video toggle update
}
...
}
Audio update
The onAudioUpdate() callback is triggered when a participant enables or disables their audio.
It provides the RtkRemoteParticipant object of the participant and their new audio state (isEnabled).
class ParticipantsEventListener extends RtkParticipantsEventListener {
...
void onAudioUpdate(RtkRemoteParticipant participant, bool isEnabled) {
// your code here to handle participant audio toggle update
}
...
}
Screen share update
The onScreenShareUpdate() callback is triggered when a participant starts or stops sharing their screen.
It provides the RtkRemoteParticipant object of the participant and their new screen share state (isEnabled).
class ParticipantsEventListener extends RtkParticipantsEventListener {
...
void onScreenShareUpdate(RtkRemoteParticipant participant, bool isEnabled) {
// your code here to handle participant screen share toggle update
}
...
}
Participant pin-unpin
The onParticipantPinned() and onParticipantUnpinned() callbacks are triggered when a remote participant is pinned or unpinned in the meeting.
These provide an RtkRemoteParticipant object, representing the pinned/unpinned participant.
class ParticipantsEventListener extends RtkParticipantsEventListener {
...
void onParticipantPinned(RtkRemoteParticipant participant) {
// your code here to show pinned participant
}
void onParticipantUnpinned(RtkRemoteParticipant participant) {
// your code here to remove the pinned participant from screen
}
...
}
Participants object updates
The onUpdate() callback is triggered whenever there is any change to the overall state of meeting.participants object.
This includes any updates to participant lists or changes in individual participant within those lists.
class ParticipantsEventListener extends RtkParticipantsEventListener {
...
void onUpdate(RtkParticipants participants) {
// your code here to fully re-render new state of 'participants' object
}
...
}
Broadcast messages
The onNewBroadcastMessage callback is triggered when a participant broadcasts a custom message to all participants in the meeting.
This callback provides:
type: String identifier for the message category. Use this to determine how to process different message types in your application.payload: JSON-serializable map (Map<String, dynamic>) containing the custom data sent by the broadcaster.
class ParticipantsEventListener extends RtkParticipantsEventListener {
...
void onNewBroadcastMessage(String type, Map<String, dynamic> payload) {
if (type == 'custom_type') {
final message = payload['message'];
// Handle the received broadcast message
print('Received $type: $message');
}
}
...
}
// Add your listener
final participantsEventListener = ParticipantsEventListener()
meeting.addParticipantsEventListener(participantsEventListener);
For information on sending broadcast messages, see the Broadcasting Messages section.