Skip to main content

Participant Events

All Participants Events​

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

Here are the supported methods:

Participant joined​

Triggers an event when any participant joins the meeting.

    private val participantsEventListener = object : DyteParticipantsEventListener {
override fun onParticipantJoin(participant: DyteRemoteParticipant) {
}
}

Participant left​

Triggers an event when any participant leaves the meeting.

    private val participantsEventListener = object : DyteParticipantsEventListener {
override fun onParticipantLeave(participant: DyteRemoteParticipant) {
}
}

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 participantEventsListener = object : DyteParticipantsEventListener {
override fun onUpdate(participants: DyteParticipants) {
// your code here to handle participant update
}
}

Video update​

Triggers an event when any participant starts / stops video.

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

Audio update​

Triggers an event when any participant starts / stops audio.

    private val participantEventsListener = object : DyteParticipantsEventListener {
override fun onAudioUpdate(participant: DyteRemoteParticipant, 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 participantEventsListener = object : DyteParticipantsEventListener {
override fun onScreenShareUpdate(participant: DyteRemoteParticipant, 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 participantEventsListener = object : DyteParticipantsEventListener {
override fun onActiveSpeakerChanged(participant: DyteRemoteParticipant?) {
// 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 participantEventsListener = object : DyteParticipantsEventListener {
override fun onParticipantPinned(participant: DyteRemoteParticipant) {
}

override fun onParticipantUnpinned(participant: DyteRemoteParticipant) {
}
}

Active participants list change​

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

    private val participantEventsListener = object : DyteParticipantsEventListener {
override fun onActiveParticipantsChanged(active: List<DyteRemoteParticipant>) {
}
}

Single Participant Events​

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

Here are the supported methods:

Participant update​

Triggers an event whenever there is any change in participant.

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

Video update​

Triggers an event when the participant starts / stops video.

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

Audio update​

Triggers an event when the participant starts / stops audio.

    private val participantUpdateListener = object : DyteParticipantUpdateListener {
override fun onAudioUpdate(participant: DyteRemoteParticipant, 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 : DyteParticipantUpdateListener {
override fun onPinned(participant: DyteRemoteParticipant) {
// your code here to show pinned participant
}

override fun onUnpinned(participant: DyteRemoteParticipant) {
// 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 : DyteParticipantUpdateListener {
override fun onScreenShareStarted(participant: DyteRemoteParticipant) {
// your code here to handle screen share started
}

override fun onScreenShareEnded(participant: DyteRemoteParticipant) {
// your code here to handle screen share ended
}
}