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.
private val participantEventsListener = object : DyteParticipantEventsListener {
override fun onParticipantJoin(participant: DyteMeetingParticipant) {
super.onParticipantJoin(participant)
// 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) {
super.onParticipantLeave(participant)
// your code here to handle participant left from meeting
}
}
Screenshare updates
Triggers an event when there is any change in screenshares in a meeting.
private val participantEventsListener = object : DyteParticipantEventsListener {
override fun onScreenSharesUpdated() {
super.onScreenSharesUpdated()
// your code here to handle screenshares from meeting
// you can use `meeting.participants.screenshares` to get latest screenshare participants
}
}
Grid change
Whenever there is any change in GridInfo
for the room following method is
called.
private val participantEventsListener = object : DyteParticipantEventsListener {
override fun onGridUpdated(gridInfo: GridInfo) {
super.onGridUpdated(gridInfo)
// your code here to handle grid changes.
}
}
Video update
Trigger an event when any participant starts / stops video.
private val participantEventsListener = object : DyteParticipantEventsListener {
override fun onVideoUpdate(videoEnabled: Boolean, participant: DyteMeetingParticipant) {
super.onVideoUpdate(videoEnabled, participant)
// your code here to handle participant video toggle update
}
}
Audio update
Trigger an event when any participant starts / stops audio.
private val participantEventsListener = object : DyteParticipantEventsListener {
override fun onAudioUpdate(audioEnabled: Boolean, participant: DyteMeetingParticipant) {
super.onAudioUpdate(audioEnabled, participant)
// your code here to handle participant audio toggle update
}
}
Active speaker
Trigger an event when any is change in active speaker in the meeting.
private val participantEventsListener = object : DyteParticipantEventsListener {
override fun onActiveSpeakerChanged(participant: DyteMeetingParticipant) {
super.onActiveSpeakerChanged(participant)
// your code here to handle active speaker
}
override fun onNoActiveSpeaker() {
super.onNoActiveSpeaker()
// your code here to handle no active speaker
}
}
Pinned participant
Trigger an event when any is change in pinned participant in the meeting.
private val participantEventsListener = object : DyteParticipantEventsListener {
override fun onParticipantPinned(participant: DyteMeetingParticipant) {
super.onParticipantPinned(participant)
// your code here to show pinned participant
}
override fun onParticipantUnpinned() {
super.onParticipantUnpinned()
// 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.
private val participantEventsListener = object : DyteParticipantEventsListener {
override fun onActiveParticipantsChanged(active: List<DyteMeetingParticipant>) {
super.onActiveParticipantsChanged(active)
// your code here to refresh active participants
}
}