Skip to main content

Participant 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.

    extension MeetingViewModel: DyteParticipantEventsListener {
func onParticipantJoin(participant: DyteMeetingParticipant) {
// your code here to handle new participant
}
}

Participant left

Triggers an event when any participant leaves the meeting.

    extension MeetingViewModel: DyteParticipantEventsListener {
func onParticipantLeave(participant: DyteMeetingParticipant) {
// your code here to handle participant left from meeting
}
}

Screenshare updates

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

    extension MeetingViewModel: DyteParticipantEventsListener {
func onScreenSharesUpdated() {
// your code here to handle screenshares from meeting
// you can use `meeting.participants.screenshares` to get latest screenshare participants
}
func onScreenShareEnded(participant: DyteMeetingParticipant) {
// your code here to handle screenshare ended
}

func onScreenShareStarted(participant: DyteMeetingParticipant) {
// your code here to handle screenshare started
}
}

Video update

Trigger an event when any participant starts / stops video.

    extension MeetingViewModel: DyteParticipantEventsListener {
func onVideoUpdate(videoEnabled: Bool, participant: DyteMeetingParticipant) {
// your code here to handle participant video toggle update
}
}

Audio update

Trigger an event when any participant starts / stops audio.

    extension MeetingViewModel: DyteParticipantEventsListener {
func onAudioUpdate(audioEnabled: Bool, participant: DyteMeetingParticipant) {
// your code here to handle participant audio toggle update
}
}

Active speaker

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

    extension MeetingViewModel: DyteParticipantEventsListener {
func onActiveSpeakerChanged(participant: DyteMeetingParticipant) {
// your code here to handle active speaker
}

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

Pinned participant

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

    extension MeetingViewModel: DyteParticipantEventsListener {
func onParticipantPinned(participant: DyteMeetingParticipant) {
// your code here to show pinned participant
}

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

Active participants list change

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

    extension MeetingViewModel: DyteParticipantEventsListener {
func onActiveParticipantsChanged(active: [DyteMeetingParticipant]) {
// your code here to refresh active participants
}
}