Skip to main content

Participant Events

All Participants Events​

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

Here are the supported methods:

Participant joined​

Triggers an event when any participant joins the meeting.

    private val participantEventsListener = object : DyteParticipantEventsListener {
override fun onParticipantJoin(participant: DyteMeetingParticipant) {
// your code here to handle new participant
}
}

Participant left​

Triggers an event when any participant leaves the meeting.

    private val participantEventsListener = object : DyteParticipantEventsListener {
override fun onParticipantLeave(participant: DyteMeetingParticipant) {
// your code here to handle participant left from meeting
}
}

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 : DyteParticipantEventsListener {
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 : DyteParticipantEventsListener {
override fun onVideoUpdate(videoEnabled: Boolean, participant: DyteMeetingParticipant) {
// your code here to handle participant video toggle update
}
}

Audio update​

Triggers an event when any participant starts / stops audio.

    private val participantEventsListener = object : DyteParticipantEventsListener {
override fun onAudioUpdate(audioEnabled: Boolean, participant: DyteMeetingParticipant) {
// 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 : DyteParticipantEventsListener {
override fun onScreenSharesUpdated() {
// your code here to handle screenshares from meeting
// you can use `meeting.participants.screenshares` to get latest screenshare participants
}

override fun onScreenShareStarted(participant: DyteJoinedMeetingParticipant) {
// participant stared presenting screen in the meeting
}

override fun onScreenShareEnded(participant: DyteJoinedMeetingParticipant) {
// participant stopped presenting screen in the meeting
}
}

Active speaker​

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

    private val participantEventsListener = object : DyteParticipantEventsListener {
override fun onActiveSpeakerChanged(participant: DyteMeetingParticipant) {
// your code here to handle active speaker
}

override fun onNoActiveSpeaker() {
// your code here to handle no active speaker
}
}

Pinned participant​

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

    private val participantEventsListener = object : DyteParticipantEventsListener {
override fun onParticipantPinned(participant: DyteMeetingParticipant) {
// your code here to show pinned participant
}

override fun onParticipantUnpinned(participant: DyteMeetingParticipant) {
// your code here to remove pinned participant
}
}

Active participants list change​

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

    private val participantEventsListener = object : DyteParticipantEventsListener {
override fun onActiveParticipantsChanged(active: List<DyteMeetingParticipant>) {
// your code here to refresh active participants
}
}

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() {
// 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(isEnabled: Boolean) {
// your code here to handle participant video toggle update
}
}

Audio update​

Triggers an event when the participant starts / stops audio.

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

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

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