Participant Events
All Participants Events
You can subscribe to events for all participants by implementing
DyteParticipantsEventListener
callback and then passing that object to
meeting.addParticipantsEventListener(dyteParticipantEventsListener)
method.
Here are the supported methods:
Participant joined
Triggers an event when any participant joins the meeting.
- Kotlin
- Java
private val participantsEventListener = object : DyteParticipantsEventListener {
override fun onParticipantJoin(participant: DyteRemoteParticipant) {
}
}
DyteParticipantsEventListener listener = new DyteParticipantsEventListener() {
@Override
public void onParticipantJoin(DyteRemoteParticipant participant) {
}
};
Participant left
Triggers an event when any participant leaves the meeting.
- Kotlin
- Java
private val participantsEventListener = object : DyteParticipantsEventListener {
override fun onParticipantLeave(participant: DyteRemoteParticipant) {
}
}
DyteParticipantsEventListener listener = new DyteParticipantsEventListener() {
@Override
public void onParticipantLeave(DyteRemoteParticipant participant) {
}
};
Participants update
Triggers an event whenever there is any change in the meeting.participants
object. This includes any updates to participant lists or changes in individual participant within those lists.
- Kotlin
- Java
private val participantEventsListener = object : DyteParticipantsEventListener {
override fun onUpdate(participants: DyteParticipants) {
// your code here to handle participant update
}
}
DyteParticipantsEventListener listener = new DyteParticipantsEventListener() {
@Override
public void onUpdate(DyteParticipants participants) {
// your code here to handle participant update
}
};
Video update
Triggers an event when any participant starts / stops video.
- Kotlin
- Java
private val participantEventsListener = object : DyteParticipantsEventListener {
override fun onVideoUpdate(participant: DyteRemoteParticipant, isEnabled: Boolean) {
// your code here to handle participant video toggle update
}
}
DyteParticipantsEventListener listener = new DyteParticipantsEventListener() {
@Override
public void onVideoUpdate(DyteRemoteParticipant participant, boolean isEnabled) {
// your code here to handle participant video toggle update
}
};
Audio update
Triggers an event when any participant starts / stops audio.
- Kotlin
- Java
private val participantEventsListener = object : DyteParticipantsEventListener {
override fun onAudioUpdate(participant: DyteRemoteParticipant, isEnabled: Boolean) {
// your code here to handle participant audio toggle update
}
}
DyteParticipantsEventListener listener = new DyteParticipantsEventListener() {
@Override
public void onAudioUpdate(@NonNull DyteRemoteParticipant participant, boolean isEnabled) {
// your code here to handle participant audio toggle update
}
};
Screenshare updates
Triggers an event when there is any change in screenshares in a meeting.
- Kotlin
- Java
private val participantEventsListener = object : DyteParticipantsEventListener {
override fun onScreenShareUpdate(participant: DyteRemoteParticipant, isEnabled: Boolean) {
// your code here to handle screenshares from meeting
// you can use `meeting.participants.screenshares` to get latest screenshare participants
}
}
DyteParticipantsEventListener listener = new DyteParticipantsEventListener() {
@Override
public void onScreenShareUpdate(@NonNull DyteRemoteParticipant participant, boolean isEnabled) {
// your code here to handle screenshares from meeting
// you can use `meeting.participants.screenshares` to get latest screenshare participants
}
};
Active speaker
Triggers an event when there is any change in active speaker in the meeting.
- Kotlin
- Java
private val participantEventsListener = object : DyteParticipantsEventListener {
override fun onActiveSpeakerChanged(participant: DyteRemoteParticipant?) {
// If participant is null, there is no active speaker
}
}
DyteParticipantsEventListener listener = new DyteParticipantsEventListener() {
@Override
public void onActiveSpeakerChanged(@Nullable DyteRemoteParticipant participant) {
// If participant is null, there is no active speaker
}
};
Pinned participant
Triggers an event when there is any change in pinned participant in the meeting.
- Kotlin
- Java
private val participantEventsListener = object : DyteParticipantsEventListener {
override fun onParticipantPinned(participant: DyteRemoteParticipant) {
}
override fun onParticipantUnpinned(participant: DyteRemoteParticipant) {
}
}
DyteParticipantsEventListener listener = new DyteParticipantsEventListener() {
@Override
public void onParticipantPinned(DyteRemoteParticipant participant) {
}
@Override
public void onParticipantUnpinned(DyteRemoteParticipant participant) {
}
};
Active participants list change
Triggers an event when there is any change in active participants list in the meeting.
- Kotlin
- Java
private val participantEventsListener = object : DyteParticipantsEventListener {
override fun onActiveParticipantsChanged(active: List<DyteRemoteParticipant>) {
}
}
DyteParticipantsEventListener listener = new DyteParticipantsEventListener() {
@Override
public void onActiveParticipantsChanged(List<DyteRemoteParticipant> participants) {
}
};
Single Participant Events
You can also subscribe to events for a single participant by implementing DyteParticipantUpdateListener
callback 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.
- Kotlin
- Java
private val participantUpdateListener = object : DyteParticipantUpdateListener {
override fun onUpdate(participant: DyteRemoteParticipant) {
// your code here to handle participant update
}
}
DyteParticipantUpdateListener participantUpdateListener = new DyteParticipantUpdateListener() {
@Override
public void onUpdate(DyteRemoteParticipant participant) {
// your code here to handle participant update
}
}
Video update
Triggers an event when the participant starts / stops video.
- Kotlin
- Java
private val participantUpdateListener = object : DyteParticipantUpdateListener {
override fun onVideoUpdate(participant: DyteRemoteParticipant, isEnabled: Boolean) {
}
}
DyteParticipantUpdateListener participantUpdateListener = new DyteParticipantUpdateListener() {
@Override
public void onVideoUpdate(DyteRemoteParticipant participant, boolean isEnabled) {
}
}
Audio update
Triggers an event when the participant starts / stops audio.
- Kotlin
- Java
private val participantUpdateListener = object : DyteParticipantUpdateListener {
override fun onAudioUpdate(participant: DyteRemoteParticipant, isEnabled: Boolean) {
// your code here to handle participant audio toggle update
}
}
DyteParticipantUpdateListener participantUpdateListener = new DyteParticipantUpdateListener() {
@Override
public void onAudioUpdate(DyteRemoteParticipant participant, boolean isEnabled) {
// your code here to handle participant audio toggle update
}
}
Pinned & Unpinned participant
Triggers an event when the participant is pinned / unpinned.
- Kotlin
- Java
private val participantUpdateListener = object : DyteParticipantUpdateListener {
override fun onPinned(participant: DyteRemoteParticipant) {
// your code here to show pinned participant
}
override fun onUnpinned(participant: DyteRemoteParticipant) {
// your code here to remove pinned participant
}
}
DyteParticipantUpdateListener participantUpdateListener = new DyteParticipantUpdateListener() {
@Override
public void onPinned(DyteRemoteParticipant participant) {
// your code here to show pinned participant
}
@Override
public void onUnpinned(DyteRemoteParticipant participant) {
// your code here to remove pinned participant
}
}
Screen share started & ended
Triggers an event when the participant starts / stops screen sharing.
- Kotlin
- Java
private val participantUpdateListener = object : DyteParticipantUpdateListener {
override fun onScreenShareStarted(participant: DyteRemoteParticipant) {
// your code here to handle screen share started
}
override fun onScreenShareEnded(participant: DyteRemoteParticipant) {
// your code here to handle screen share ended
}
}
DyteParticipantUpdateListener participantUpdateListener = new DyteParticipantUpdateListener() {
@Override
public void onScreenShareStarted(DyteRemoteParticipant participant) {
// your code here to handle screen share started
}
@Override
public void onScreenShareEnded(DyteRemoteParticipant participant) {
// your code here to handle screen share ended
}
}