All Participant Events
You can subscribe to events for all participants by implementing
DyteParticipantEventsListener protocol 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
        }
    }
Participant update
Triggers an event whenever there is any change in participant.
    extension MeetingViewModel: DyteParticipantEventsListener {
        func onUpdate(participants: DyteParticipants) {
            // your code here to handle participant update
        }
    }
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
        }
    }
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 onScreenShareStarted(participant: DyteJoinedMeetingParticipant) {
            // participant stared presenting screen in the meeting
        }
        func onScreenShareEnded(participant: DyteJoinedMeetingParticipant) {
            // participant stopped presenting screen in the meeting
        }
    }
Active speaker
Triggers 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
Triggers an event when there is any change in pinned participant in the meeting.
    extension MeetingViewModel: DyteParticipantEventsListener {
        func onParticipantPinned(participant: DyteMeetingParticipant) {
            // your code here to show pinned participant
        }
        func onParticipantUnpinned(participant: DyteJoinedMeetingParticipant) {
            // your code here to remove pinned participant
        }
    }
Active participants list change
Triggers an event when any is change in active participants list in the meeting.
    extension MeetingViewModel: DyteParticipantEventsListener {
        func onActiveParticipantsChanged(active: [DyteMeetingParticipant]) {
            // your code here to refresh active participants
        }
    }
Single Participant Events
You can also subscribe to events for a single participant by implementing DyteParticipantUpdateListener protocol 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.
    extension MeetingViewModel: DyteParticipantUpdateListener {
        func onUpdate() {
            // your code here to handle participant update
        }
    }
Video update
Triggers an event when the participant starts / stops video.
    extension MeetingViewModel: DyteParticipantUpdateListener {
        func onVideoUpdate(isEnabled: Bool) {
            // your code here to handle participant video toggle update
        }
    }
Audio update
Triggers an event when the participant starts / stops audio.
    extension MeetingViewModel: DyteParticipantUpdateListener {
        func onAudioUpdate(isEnabled: Bool) {
            // your code here to handle participant audio toggle update
        }
    }
Pinned & Unpinned participant
Triggers an event when the participant is pinned / unpinned.
    extension MeetingViewModel: DyteParticipantUpdateListener {
        func onPinned() {
            // your code here to show pinned participant
        }
        func onUnpinned() {
            // your code here to remove pinned participant
        }
    }
Screen share started & ended
Triggers an event when the participant starts / stops screen sharing.
    extension MeetingViewModel: DyteParticipantUpdateListener {
        func onScreenShareStarted() {
            // your code here to handle screen share started
        }
        func onScreenShareEnded() {
            // your code here to handle screen share ended
        }
    }