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()
.
- Kotlin
- Java
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.
}
}
})
meeting.addSelfEventsListener(new DyteSelfEventsListener() {
@Override
public void onVideoUpdate(boolean isEnabled) {
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()
.
- Kotlin
- Java
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.
}
}
})
meeting.addSelfEventsListener(new DyteSelfEventsListener() {
override fun onAudioUpdate(boolean isEnabled) {
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
- Kotlin
- Java
val waitListStatus = meeting.localUser.waitListStatus
WaitListStatus waitListStatus = meeting.localUser.getWaitListStatus();
You can listen to those changes in onWaitListStatusUpdate()
callbacks
- Kotlin
- Java
meeting.addSelfEventsListener(object : DyteSelfEventsListener {
override fun onWaitListStatusUpdate(waitListStatus: WaitListStatus) {
// handle waitlist status here
}
})
meeting.addSelfEventsListener(new DyteSelfEventsListener() {
@Override
public void onWaitListStatusUpdate(WaitListStatus waitListStatus) {
// handle waitlist status here
}
});
Screenshare callbacks for local user
- Kotlin
- Java
meeting.addSelfEventsListener(object : DyteSelfEventsListener {
override fun onScreenShareStartFailed(reason: String) {
}
override fun onScreenShareUpdate(isEnabled: Boolean) {
}
})
meeting.addSelfEventsListener(new DyteSelfEventsListener() {
@Override
public void onScreenShareStartFailed(@NonNull String reason) {
}
@Override
public void onScreenShareUpdate(boolean isEnabled) {
}
});
Device permission callbacks once local user is joined in the meeting
- Kotlin
- Java
meeting.addSelfEventsListener(object : DyteSelfEventsListener {
override fun onMeetingRoomJoinedWithoutCameraPermission() {
}
override fun onMeetingRoomJoinedWithoutMicPermission() {
}
})
meeting.addSelfEventsListener(new DyteSelfEventsListener() {
@Override
public void onMeetingRoomJoinedWithoutCameraPermission() {
}
@Override
public void onMeetingRoomJoinedWithoutMicPermission() {
}
});
When local user is kicked out from the meeting by a remote user
- Kotlin
- Java
meeting.addSelfEventsListener(object : DyteSelfEventsListener {
override fun onRemovedFromMeeting() {
}
});
meeting.addSelfEventsListener(new DyteSelfEventsListener() {
@Override
public void onRemovedFromMeeting() {
}
})