Skip to main content

Participant Events

All Participants Events​

You can subscribe to events for all participants by implementing RtkParticipantsEventListener callback and then passing that object to meeting.addParticipantsEventListener(rtkParticipantsEventListener) method.

Here are the supported methods:

Participant joined​

Triggers an event when any participant joins the meeting.

private val participantsEventListener = object : RtkParticipantsEventListener {
override fun onParticipantJoin(participant: RtkRemoteParticipant) {
}
}

Participant left​

Triggers an event when any participant leaves the meeting.

private val participantsEventListener = object : RtkParticipantsEventListener {
override fun onParticipantLeave(participant: RtkRemoteParticipant) {
}
}

Participants update​

Triggers an event whenever there is any change in the meeting.participants object. This includes any updates to participant lists or changes in individual participant within those lists.

private val participantsEventListener = object : RtkParticipantsEventListener {
override fun onUpdate(participants: RtkParticipants) {
// your code here to handle participant update
}
}

Video update​

Triggers an event when any participant starts / stops video.

private val participantsEventListener = object : RtkParticipantsEventListener {
override fun onVideoUpdate(participant: RtkRemoteParticipant, isEnabled: Boolean) {
// your code here to handle participant video toggle update
}
}

Audio update​

Triggers an event when any participant starts / stops audio.

private val participantsEventListener = object : RtkParticipantsEventListener {
override fun onAudioUpdate(participant: RtkRemoteParticipant, isEnabled: Boolean) {
// your code here to handle participant audio toggle update
}
}

Screenshare updates​

Triggers an event when there is any change in screenshares in a meeting.

private val participantsEventListener = object : RtkParticipantsEventListener {
override fun onScreenShareUpdate(participant: RtkRemoteParticipant, isEnabled: Boolean) {
// your code here to handle screenshares from meeting
// you can use `meeting.participants.screenshares` to get latest screenshare participants
}
}

Active speaker​

Triggers an event when there is any change in active speaker in the meeting.

private val participantsEventListener = object : RtkParticipantsEventListener {
override fun onActiveSpeakerChanged(participant: RtkRemoteParticipant?) {
// If participant is null, there is no active speaker
}
}

Pinned participant​

Triggers an event when there is any change in pinned participant in the meeting.

private val participantsEventListener = object : RtkParticipantsEventListener {
override fun onParticipantPinned(participant: RtkRemoteParticipant) {
}

override fun onParticipantUnpinned(participant: RtkRemoteParticipant) {
}
}

Active participants list change​

Triggers an event when there is any change in active participants list in the meeting.

private val participantsEventListener = object : RtkParticipantsEventListener {
override fun onActiveParticipantsChanged(active: List<RtkRemoteParticipant>) {
}
}

Single Participant Events​

You can also subscribe to events for a single participant by implementing RtkParticipantUpdateListener callback and then passing that object to participant.addParticipantUpdateListener(RtkParticipantUpdateListener) method.

Here are the supported methods:

Participant update​

Triggers an event whenever there is any change in participant.

private val participantUpdateListener = object : RtkParticipantUpdateListener {
override fun onUpdate(participant: RtkRemoteParticipant) {
// your code here to handle participant update
}
}

Video update​

Triggers an event when the participant starts / stops video.

private val participantUpdateListener = object : RtkParticipantUpdateListener {
override fun onVideoUpdate(participant: RtkRemoteParticipant, isEnabled: Boolean) {
}
}

Audio update​

Triggers an event when the participant starts / stops audio.

private val participantUpdateListener = object : RtkParticipantUpdateListener {
override fun onAudioUpdate(participant: RtkRemoteParticipant, isEnabled: Boolean) {
// your code here to handle participant audio toggle update
}
}

Pinned & Unpinned participant​

Triggers an event when the participant is pinned / unpinned.

private val participantUpdateListener = object : RtkParticipantUpdateListener {
override fun onPinned(participant: RtkRemoteParticipant) {
// your code here to show pinned participant
}

override fun onUnpinned(participant: RtkRemoteParticipant) {
// your code here to remove pinned participant
}
}

Screen share started & ended​

Triggers an event when the participant starts / stops screen sharing.

private val participantUpdateListener = object : RtkParticipantUpdateListener {
override fun onScreenShareUpdate(participant: RtkMeetingParticipant, isEnabled: Boolean) {
}
}