Skip to main content

Events

Local User - Events

You can subscribe to various events on the local user by implementing DyteSelfEventsListener and passing the object to meeting.addSelfEventsListener(dyteSelfEventsListener).

Video update

Triggered when the user starts/stops the video using enableVideo() or disableVideo().

meeting.addSelfEventsListener(object : DyteSelfEventsListener {
override fun onVideoUpdate(isEnabled: Boolean) {
if (isEnabled) {
// video is enabled, and other participants in room can see local user
} else {
// video is disabled, and other participants in room can not see local user.
}
}
})

Audio update

Triggered when the user starts/stops the audio using enableAudio() or disableAudio().

meeting.addSelfEventsListener(object : DyteSelfEventsListener {
override fun onAudioUpdate(isEnabled: Boolean) {
if (isEnabled) {
// audio is enabled, and other participants in room can hear local user
} else {
// audio is disabled, and other participants in room can not hear local user.
}
}
})

Waitlist status

For meetings whose waiting room is enabled:

To get status of localUser in waiting room we can use

val waitListStatus = meeting.localUser.waitListStatus

You can listen to those changes in onWaitListStatusUpdate() callbacks

meeting.addSelfEventsListener(object : DyteSelfEventsListener {
override fun onWaitListStatusUpdate(waitListStatus: WaitListStatus) {
// handle waitlist status here
}
})

Screenshare callbacks for local user

meeting.addSelfEventsListener(object : DyteSelfEventsListener {
override fun onScreenShareStartFailed(reason: String) {
}

override fun onScreenShareUpdate(isEnabled: Boolean) {
}
})

Device permission callbacks once local user is joined in the meeting

meeting.addSelfEventsListener(object : DyteSelfEventsListener {
override fun onMeetingRoomJoinedWithoutCameraPermission() {
}

override fun onMeetingRoomJoinedWithoutMicPermission() {
}
})

When local user is kicked out from the meeting by a remote user

meeting.addSelfEventsListener(object : DyteSelfEventsListener {
override fun onRemovedFromMeeting() {
}
});