From 12e70ecdb4851f381f2a4bb8a4ab342fe415e0b5 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 26 Dec 2024 10:04:57 +0530 Subject: [PATCH 1/6] MOB-1904: update remote participants section for mobile-core v2 --- docs/android-core/participants/events.mdx | 262 ++++++++++++------ .../participants/participant-object.mdx | 124 ++++++++- .../participants/remote-participants.mdx | 23 +- .../participants/waitlisted-participants.mdx | 87 +++++- 4 files changed, 379 insertions(+), 117 deletions(-) diff --git a/docs/android-core/participants/events.mdx b/docs/android-core/participants/events.mdx index f9051b6b0..25f29b60b 100644 --- a/docs/android-core/participants/events.mdx +++ b/docs/android-core/participants/events.mdx @@ -22,197 +22,283 @@ Here are the supported methods: Triggers an event when any participant joins the meeting. + + + ```kotlin private val participantEventsListener = object : DyteParticipantEventsListener { - override fun onParticipantJoin(participant: DyteMeetingParticipant) { - // your code here to handle new participant + override fun onParticipantJoin(participant: DyteRemoteParticipant) { } } ``` + + + + +```java + DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + @Override + public void onParticipantJoin(DyteRemoteParticipant participant) { + } + }; +``` + + + + ### Participant left Triggers an event when any participant leaves the meeting. + + + ```kotlin private val participantEventsListener = object : DyteParticipantEventsListener { - override fun onParticipantLeave(participant: DyteMeetingParticipant) { - // your code here to handle participant left from meeting + override fun onParticipantLeave(participant: DyteRemoteParticipant) { } } ``` + + + + + +```java + DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + @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 private val participantEventsListener = object : DyteParticipantEventsListener { - override fun onUpdate(participants: DyteParticipants) { + override fun onAllParticipantsUpdated(allParticipants: List) { // your code here to handle participant update } } ``` + + + + +```java + DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + @Override + public void onAllParticipantsUpdated(List participants) { + // your code here to handle participant update + } + }; +``` + + + + ### Video update Triggers an event when any participant starts / stops video. -```kotlin - private val participantEventsListener = object : DyteParticipantEventsListener { - override fun onVideoUpdate(videoEnabled: Boolean, participant: DyteMeetingParticipant) { + + + + ```kotlin + private val participantEventsListener = object : DyteParticipantEventsListener { + override fun onVideoUpdate(participant: DyteRemoteParticipant, isEnabled: Boolean) { + // your code here to handle participant video toggle update + } + } + ``` + + + + + +```java + DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + @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 private val participantEventsListener = object : DyteParticipantEventsListener { - override fun onAudioUpdate(audioEnabled: Boolean, participant: DyteMeetingParticipant) { + override fun onAudioUpdate(participant: DyteRemoteParticipant, isEnabled: Boolean) { // your code here to handle participant audio toggle update } } ``` + + + + +```java + DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + @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 private val participantEventsListener = object : DyteParticipantEventsListener { - override fun onScreenSharesUpdated() { + 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 } + } +``` - override fun onScreenShareStarted(participant: DyteJoinedMeetingParticipant) { - // participant stared presenting screen in the meeting - } + - override fun onScreenShareEnded(participant: DyteJoinedMeetingParticipant) { - // participant stopped presenting screen in the meeting + + +```java + DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + @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 private val participantEventsListener = object : DyteParticipantEventsListener { - override fun onActiveSpeakerChanged(participant: DyteMeetingParticipant) { - // your code here to handle active speaker - } - - override fun onNoActiveSpeaker() { - // your code here to handle no active speaker + override fun onActiveSpeakerChanged(participant: DyteRemoteParticipant?) { + // 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 - private val participantEventsListener = object : DyteParticipantEventsListener { - override fun onParticipantPinned(participant: DyteMeetingParticipant) { - // your code here to show pinned participant - } + - override fun onParticipantUnpinned(participant: DyteMeetingParticipant) { - // your code here to remove pinned participant +```java + DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + @Override + public void onActiveSpeakerChanged(@Nullable DyteRemoteParticipant participant) { + // If participant is null, there is no active speaker } - } + }; ``` -### Active participants list change + + -Triggers an event when there is any change in active participants list in the meeting. +### Pinned participant + +Triggers an event when there is any change in pinned participant in the meeting. + + + ```kotlin private val participantEventsListener = object : DyteParticipantEventsListener { - override fun onActiveParticipantsChanged(active: List) { - // your code here to refresh active participants + override fun onParticipantPinned(participant: DyteRemoteParticipant) { + } + + override fun onParticipantUnpinned(participant: DyteRemoteParticipant) { } } ``` -## 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 - private val participantUpdateListener = object : DyteParticipantUpdateListener { - override fun onUpdate() { - // your code here to handle participant update + DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + @Override + public void onParticipantPinned(DyteRemoteParticipant participant) { } - } -``` - -### Video update - -Triggers an event when the participant starts / stops video. -```kotlin - private val participantUpdateListener = object : DyteParticipantUpdateListener { - override fun onVideoUpdate(isEnabled: Boolean) { - // your code here to handle participant video toggle update + @Override + public void onParticipantUnpinned(DyteRemoteParticipant participant) { } - } + }; ``` -### Audio update - -Triggers an event when the participant starts / stops audio. + + -```kotlin - private val participantUpdateListener = object : DyteParticipantUpdateListener { - override fun onAudioUpdate(isEnabled: Boolean) { - // your code here to handle participant audio toggle update - } - } -``` +### Active participants list change -### Pinned & Unpinned participant +Triggers an event when there is any change in active participants list in the meeting. -Triggers an event when the participant is pinned / unpinned. + + ```kotlin - private val participantUpdateListener = object : DyteParticipantUpdateListener { - override fun onPinned() { - // your code here to show pinned participant - } - - override fun onUnpinned() { - // your code here to remove pinned participant + private val participantEventsListener = object : DyteParticipantEventsListener { + override fun onActiveParticipantsChanged(active: List) { } } ``` -### Screen share started & ended + -Triggers an event when the participant starts / stops screen sharing. + ```kotlin - private val participantUpdateListener = object : DyteParticipantUpdateListener { - override fun onScreenShareStarted() { - // your code here to handle screen share started - } - - override fun onScreenShareEnded() { - // your code here to handle screen share ended + DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + @Override + public void onActiveParticipantsChanged(List participants) { } - } + }; ``` + + + diff --git a/docs/android-core/participants/participant-object.mdx b/docs/android-core/participants/participant-object.mdx index 36b6b353b..768ccb468 100644 --- a/docs/android-core/participants/participant-object.mdx +++ b/docs/android-core/participants/participant-object.mdx @@ -20,32 +20,27 @@ The participant object has the following properties. - `userId`: The `userId` of the participant. - `name`: The participant's name. - `picture`: The participant's picture (if any). -- `clientSpecificId`: An arbitrary ID that can be set to identify the +- `customParticipantId`: An arbitrary ID that can be set to identify the participant. -- `videoTrack`: The video track of the participant. -- `screenShareTrack`: The video and audio (if any) track of the participant's - screen share stream. - `videoEnabled`: Set to true if the participant's camera is on. - `audioEnabled`: Set to true if the participant is unmuted. - `isPinned`: True if current user is pinned in the meeting room. - `presetName`: Name of the preset associated with the participant. - `stageStatus`: Status of stage for the participant -- `maxNumberOnScreen`: A int showing the maximum number of people set for this meeting. -- `currentPageNumber`: A int showing the current page in this meeting. Participants from this page are filled in the `active` list. -- `pageCount`: A int showing total number of pages available in the meeting. -- `canGoNextPage`: A boolean indicating if next page of joined participants is available to show. -- `canGoPreviousPage`: A boolean indicating if previous page of joined participants is available to show. ## To get video view of a given participant You can call `participant.getVideoView()` which will return a View which further can used to add in any ViewGroup in android. -Similarly one can use `participant.getScreenShareView()` which will return a +Similarly one can use `participant.getScreenShareVideoView()` which will return a View which further can used to add in any ViewGroup in android. Similarly, you can also access the pagination related information like follows: + + + ```kotlin val maxNumberOnScreen = meeting.participants.maxNumberOnScreen val currentPageNumber = meeting.participants.currentPageNumber @@ -54,37 +49,99 @@ val canGoNextPage = meeting.participants.canGoNextPage val canGoPreviousPage = meeting.participants.canGoPreviousPage ``` + + + + +```java +int maxNumberOnScreen = meeting.participants.getMaxNumberOnScreen(); +int currentPageNumber = meeting.participants.getCurrentPageNumber(); +int pageCount = meeting.participants.getPageCount(); +boolean canGoNextPage = meeting.participants.getCanGoNextPage(); +boolean canGoPreviousPage = meeting.participants.getCanGoPreviousPage(); +``` + + + + ## Move between pages in paginated mode -The `setPage(pageNumber: Int)` method allows you to switch between pages of participants present in the meeting. +The `setPage` method allows you to switch between pages of participants present in the meeting. + + + ```kotlin // switch to 1st page meeting.participants.setPage(1) ``` + + + + +```java +// switch to 1st page +meeting.participants.setPage(1) +``` + + + + ## Host Controls If you (the local user) have the relevant permissions, you can disable a participant's video or audio, or kick them from the meeting. + + + ```kotlin val participant = meeting.participants.joined.firstOrNull { it.id == participantId } participant?.let { pcpt -> // To disable a participant's video stream - pcpt.disableVideo(); + pcpt.disableVideo() // To disable a participant's audio stream - pcpt.disableAudio(); + pcpt.disableAudio() // To kick a participant from the meeting - pcpt.kick(); + pcpt.kick() } ``` + + + + +```java +Optional participant = meeting.getParticipants().getJoined() + .stream() + .filter(pcpt -> pcpt.getId().equals(participantId)) + .findFirst(); + +participant.ifPresent(pcpt -> { + // To disable a participant's video stream + pcpt.disableVideo(); + + // To disable a participant's audio stream + pcpt.disableAudio(); + + // To kick a participant from the meeting + pcpt.kick(); +}); +``` + + + + You can also `pin` or `unpin` a participant in the meeting. All "pinned" participants are added to the `meeting.participants.pinned` list. + + + + ```kotlin val participant = meeting.participants.joined.firstOrNull { it.id == participantId } @@ -97,6 +154,28 @@ participant?.let { pcpt -> } ``` + + + + +```java +Optional participant = meeting.getParticipants().getJoined() + .stream() + .filter(pcpt -> pcpt.getId().equals(participantId)) + .findFirst(); + +participant.ifPresent(pcpt -> { + // To pin a participant + pcpt.pin(); + + // To unpin a participant + pcpt.unpin(); +}); +``` + + + + ## Broadcast message to all participants Send a message to all `joined` participants. @@ -105,13 +184,28 @@ _Parameters_: `type`: A client-specific type to differentiate between custom messages like "emoji" or "greetings" -`payload`: A map containing the message payload, where keys are strings and values are of `Any` type. +`payload`: A Map containing the message payload, of type `Map`. + + + ```kotlin // broadcast message meeting.participants.broadcastMessage(type, payload) ``` + + + + +```java +// broadcast message +meeting.participants.broadcastMessage(type, payload); +``` + + + + Android Core The participant object + + ```kotlin // get all joined participants -val joined: List = meeting.participants.joined +val joined: List = meeting.participants.joined // get active participants val active: List = meeting.participants.active ``` + + + + +```java +// get all joined participants +List joined = meeting.getParticipants().getJoined(); + +// get active participants +List active = meeting.getParticipants().getActive(); +``` + + + + + The `meeting.participants` object has the following **lists** of participants - **joined**: A list that contains all the participants who are currently in the meeting @@ -32,8 +51,6 @@ The `meeting.participants` object has the following **lists** of participants Therefore if you were to make a video / audio grid of participants, you'd use the `active` list, but to display the list of all participants in the meeting you'd use the `joined` list. -Each participant in each of the `joined`, `active`, `pinned` and `screenShares` list are of type `DyteJoinedMeetingParticipant`, `waitlisted` list is of type `DyteWaitlistedParticipant`. - Android Core Participants diff --git a/docs/android-core/participants/waitlisted-participants.mdx b/docs/android-core/participants/waitlisted-participants.mdx index 5fc073492..bf48ea256 100644 --- a/docs/android-core/participants/waitlisted-participants.mdx +++ b/docs/android-core/participants/waitlisted-participants.mdx @@ -9,55 +9,120 @@ tags: - waiting room --- -Participants in the waiting room are represented by `DyteWaitlistedParticipant` objects. If the local user has the permission to -accept waiting room requests (`selfPermissions.host.canAcceptRequests` is true), you can manage pending waiting room requests, +Participants in the waiting room are represented by `DyteRemoteParticipant` objects. If the local user has the permission to +accept waiting room requests (`selfPermissions.host.canAcceptRequests` is true), you can manage pending waiting room requests, accepting or rejecting them as needed. -You can access the list of waitlisted participants via the `meeting.participants.waitlisted` property. +You can access the list of waitlisted participants via the `meeting.participants.waitlisted` property. **Note**: If the local user is not a host, `meeting.participants.waitlisted` property returns an empty list. ### Accepting Requests -To accept a waiting room request, use the acceptWaitListedRequest() method on a `DyteWaitlistedParticipant` object: +To accept a waiting room request, use the `acceptWaitingRoomRequest(String)` method on a `DyteParticipants` object: + + + ```kotlin val waitlistedParticipant = meeting.participants.waitlisted[0] -waitlistedParticipant.acceptWaitListedRequest() +meeting.participants.acceptWaitingRoomRequest(waitlistedParticipant.id) ``` + + + + +```kotlin +DyteRemoteParticipant waitlistedParticipant = meeting.getParticipants().getWaitlisted().get(0); +meeting.getParticipants().acceptWaitingRoomRequest(waitlistedParticipant.id); +``` + + + + + ### Rejecting Requests -To deny a waiting room request, use the `rejectWaitListedRequest()` method on a `DyteWaitlistedParticipant` object: +To deny a waiting room request, use the `rejectWaitingRoomRequest(String)` method on a `DyteParticipants` object: + + + ```kotlin val waitlistedParticipant = meeting.participants.waitlisted[0] waitlistedParticipant.rejectWaitListedRequest() ``` + + + + +```java +DyteRemoteParticipant waitlistedParticipant = meeting.getParticipants().getWaitlisted().get(0); +meeting.getParticipants().rejectWaitingRoomRequest(waitlistedParticipant.id); +``` + + + + ### Waiting Room Events Implement the `DyteWaitlistEventsListener` interface to listen for events related to the waiting room: + + + ```kotlin meeting.addWaitlistEventsListener(object: DyteWaitlistEventsListener { - override fun onWaitListParticipantJoined(participant: DyteWaitlistedParticipant) { + override fun onWaitListParticipantJoined(participant: DyteRemoteParticipant) { // Triggered when a new participant joins the waiting room } - override fun onWaitListParticipantAccepted(participant: DyteWaitlistedParticipant) { + override fun onWaitListParticipantAccepted(participant: DyteRemoteParticipant) { // Triggered when a waitlisted participant is accepted into the meeting } - override fun onWaitListParticipantRejected(participant: DyteWaitlistedParticipant) { + override fun onWaitListParticipantRejected(participant: DyteRemoteParticipant) { // Triggered when a waitlisted participant is denied entry into the meeting } - override fun onWaitListParticipantClosed(participant: DyteWaitlistedParticipant) { + override fun onWaitListParticipantClosed(participant: DyteRemoteParticipant) { // Triggered when a waitlisted participant leaves the waiting room } }) ``` + + + + +```kotlin +meeting.addWaitlistEventsListener(new DyteWaitlistEventsListener() { + @Override + public void onWaitListParticipantJoined(DyteRemoteParticipant participant) { + // Triggered when a new participant joins the waiting room + } + + @Override + public void onWaitListParticipantAccepted(DyteRemoteParticipant participant) { + // Triggered when a waitlisted participant is accepted into the meeting + } + + @Override + public void onWaitListParticipantRejected(DyteRemoteParticipant participant) { + // Triggered when a waitlisted participant is denied entry into the meeting + } + + @Override + public void onWaitListParticipantClosed(DyteRemoteParticipant participant) { + // Triggered when a waitlisted participant leaves the waiting room + } +}) +``` + + + + Android Core Waitlisted Participants - \ No newline at end of file + From 85b39f938abe1859cc0eb0fac9e71c970080bf63 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 26 Dec 2024 10:08:34 +0530 Subject: [PATCH 2/6] MOB-1921: update link to waitlisted participants methods --- docs/android-core/pre-call/4-waiting-room.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/android-core/pre-call/4-waiting-room.mdx b/docs/android-core/pre-call/4-waiting-room.mdx index 8b9c69c86..fca489b82 100644 --- a/docs/android-core/pre-call/4-waiting-room.mdx +++ b/docs/android-core/pre-call/4-waiting-room.mdx @@ -99,4 +99,4 @@ meeting.addSelfEventsListener(new DyteSelfEventsListener() { -Host can use [these methods to accept/reject participants](/android-core/participants#waiting-room-methods). +Host can use [these methods to accept/reject participants](/android-core/participants/waitlisted-participants). From 90a9d4f7d03e5e84b750d4a2cfe44c0f19457516 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya <122249239+harshs-dyte@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:56:13 +0530 Subject: [PATCH 3/6] Apply suggestions from code review Co-authored-by: Swapnil Madavi <30936566+swapnilmadavi@users.noreply.github.com> --- docs/android-core/participants/events.mdx | 12 ++++++------ .../participants/remote-participants.mdx | 2 +- .../participants/waitlisted-participants.mdx | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/android-core/participants/events.mdx b/docs/android-core/participants/events.mdx index 25f29b60b..575db3b8b 100644 --- a/docs/android-core/participants/events.mdx +++ b/docs/android-core/participants/events.mdx @@ -26,7 +26,7 @@ Triggers an event when any participant joins the meeting. ```kotlin - private val participantEventsListener = object : DyteParticipantEventsListener { + private val participantsEventListener = object : DyteParticipantsEventListener { override fun onParticipantJoin(participant: DyteRemoteParticipant) { } } @@ -37,7 +37,7 @@ Triggers an event when any participant joins the meeting. ```java - DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + DyteParticipantsEventListener listener = new DyteParticipantsEventListener() { @Override public void onParticipantJoin(DyteRemoteParticipant participant) { } @@ -55,7 +55,7 @@ Triggers an event when any participant leaves the meeting. ```kotlin - private val participantEventsListener = object : DyteParticipantEventsListener { + private val participantsEventListener = object : DyteParticipantsEventListener { override fun onParticipantLeave(participant: DyteRemoteParticipant) { } } @@ -67,7 +67,7 @@ Triggers an event when any participant leaves the meeting. ```java - DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + DyteParticipantsEventListener listener = new DyteParticipantsEventListener() { @Override public void onParticipantLeave(DyteRemoteParticipant participant) { } @@ -88,7 +88,7 @@ Triggers an event whenever there is any change in the `meeting.participants` obj ```kotlin private val participantEventsListener = object : DyteParticipantEventsListener { - override fun onAllParticipantsUpdated(allParticipants: List) { + override fun onUpdate(participants: DyteParticipants) { // your code here to handle participant update } } @@ -101,7 +101,7 @@ Triggers an event whenever there is any change in the `meeting.participants` obj ```java DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { @Override - public void onAllParticipantsUpdated(List participants) { + public void onUpdate(DyteParticipants participants) { // your code here to handle participant update } }; diff --git a/docs/android-core/participants/remote-participants.mdx b/docs/android-core/participants/remote-participants.mdx index 3d662b5d8..07953fd56 100644 --- a/docs/android-core/participants/remote-participants.mdx +++ b/docs/android-core/participants/remote-participants.mdx @@ -20,7 +20,7 @@ The data regarding all meeting participants is stored under `meeting.participant val joined: List = meeting.participants.joined // get active participants -val active: List = meeting.participants.active +val active: List = meeting.participants.active ``` diff --git a/docs/android-core/participants/waitlisted-participants.mdx b/docs/android-core/participants/waitlisted-participants.mdx index bf48ea256..f9b99d517 100644 --- a/docs/android-core/participants/waitlisted-participants.mdx +++ b/docs/android-core/participants/waitlisted-participants.mdx @@ -50,7 +50,7 @@ To deny a waiting room request, use the `rejectWaitingRoomRequest(String)` metho ```kotlin val waitlistedParticipant = meeting.participants.waitlisted[0] -waitlistedParticipant.rejectWaitListedRequest() +meeting.participants.rejectWaitingRoomRequest(waitlistedParticipant.id) ``` From 02eedd27a920bd0ba4c8fd28545b3fe12e27ff2e Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 6 Jan 2025 15:04:16 +0530 Subject: [PATCH 4/6] fix: adapt to renamed participant events listeners --- docs/android-core/participants/events.mdx | 32 +++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/android-core/participants/events.mdx b/docs/android-core/participants/events.mdx index 575db3b8b..6deec501d 100644 --- a/docs/android-core/participants/events.mdx +++ b/docs/android-core/participants/events.mdx @@ -13,8 +13,8 @@ tags: ## All Participants Events You can subscribe to events for all participants by implementing -`DyteParticipantEventsListener` callback and then passing that object to -`meeting.addParticipantEventsListener(dyteParticipantEventsListener)` method. +`DyteParticipantsEventListener` callback and then passing that object to +`meeting.addParticipantsEventListener(dyteParticipantEventsListener)` method. Here are the supported methods: @@ -87,7 +87,7 @@ Triggers an event whenever there is any change in the `meeting.participants` obj ```kotlin - private val participantEventsListener = object : DyteParticipantEventsListener { + private val participantEventsListener = object : DyteParticipantsEventListener { override fun onUpdate(participants: DyteParticipants) { // your code here to handle participant update } @@ -99,7 +99,7 @@ Triggers an event whenever there is any change in the `meeting.participants` obj ```java - DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + DyteParticipantsEventListener listener = new DyteParticipantsEventListener() { @Override public void onUpdate(DyteParticipants participants) { // your code here to handle participant update @@ -118,7 +118,7 @@ Triggers an event when any participant starts / stops video. ```kotlin - private val participantEventsListener = object : DyteParticipantEventsListener { + private val participantEventsListener = object : DyteParticipantsEventListener { override fun onVideoUpdate(participant: DyteRemoteParticipant, isEnabled: Boolean) { // your code here to handle participant video toggle update } @@ -130,7 +130,7 @@ Triggers an event when any participant starts / stops video. ```java - DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + DyteParticipantsEventListener listener = new DyteParticipantsEventListener() { @Override public void onVideoUpdate(DyteRemoteParticipant participant, boolean isEnabled) { // your code here to handle participant video toggle update @@ -150,7 +150,7 @@ Triggers an event when any participant starts / stops audio. ```kotlin - private val participantEventsListener = object : DyteParticipantEventsListener { + private val participantEventsListener = object : DyteParticipantsEventListener { override fun onAudioUpdate(participant: DyteRemoteParticipant, isEnabled: Boolean) { // your code here to handle participant audio toggle update } @@ -162,7 +162,7 @@ Triggers an event when any participant starts / stops audio. ```java - DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + DyteParticipantsEventListener listener = new DyteParticipantsEventListener() { @Override public void onAudioUpdate(@NonNull DyteRemoteParticipant participant, boolean isEnabled) { // your code here to handle participant audio toggle update @@ -181,7 +181,7 @@ Triggers an event when there is any change in screenshares in a meeting. ```kotlin - private val participantEventsListener = object : DyteParticipantEventsListener { + 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 @@ -194,7 +194,7 @@ Triggers an event when there is any change in screenshares in a meeting. ```java - DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + DyteParticipantsEventListener listener = new DyteParticipantsEventListener() { @Override public void onScreenShareUpdate(@NonNull DyteRemoteParticipant participant, boolean isEnabled) { // your code here to handle screenshares from meeting @@ -214,7 +214,7 @@ Triggers an event when there is any change in active speaker in the meeting. ```kotlin - private val participantEventsListener = object : DyteParticipantEventsListener { + private val participantEventsListener = object : DyteParticipantsEventListener { override fun onActiveSpeakerChanged(participant: DyteRemoteParticipant?) { // If participant is null, there is no active speaker } @@ -226,7 +226,7 @@ Triggers an event when there is any change in active speaker in the meeting. ```java - DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + DyteParticipantsEventListener listener = new DyteParticipantsEventListener() { @Override public void onActiveSpeakerChanged(@Nullable DyteRemoteParticipant participant) { // If participant is null, there is no active speaker @@ -245,7 +245,7 @@ Triggers an event when there is any change in pinned participant in the meeting. ```kotlin - private val participantEventsListener = object : DyteParticipantEventsListener { + private val participantEventsListener = object : DyteParticipantsEventListener { override fun onParticipantPinned(participant: DyteRemoteParticipant) { } @@ -260,7 +260,7 @@ Triggers an event when there is any change in pinned participant in the meeting. ```kotlin - DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + DyteParticipantsEventListener listener = new DyteParticipantsEventListener() { @Override public void onParticipantPinned(DyteRemoteParticipant participant) { } @@ -282,7 +282,7 @@ Triggers an event when there is any change in active participants list in the me ```kotlin - private val participantEventsListener = object : DyteParticipantEventsListener { + private val participantEventsListener = object : DyteParticipantsEventListener { override fun onActiveParticipantsChanged(active: List) { } } @@ -293,7 +293,7 @@ Triggers an event when there is any change in active participants list in the me ```kotlin - DyteParticipantsEventListener listener = new DyteParticipantEventsListener() { + DyteParticipantsEventListener listener = new DyteParticipantsEventListener() { @Override public void onActiveParticipantsChanged(List participants) { } From 882a3fe5a0b3646b3012ab420965f8a0564e1904 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 6 Jan 2025 15:20:31 +0530 Subject: [PATCH 5/6] fix: restore single participant events section --- docs/android-core/participants/events.mdx | 181 ++++++++++++++++++++++ 1 file changed, 181 insertions(+) diff --git a/docs/android-core/participants/events.mdx b/docs/android-core/participants/events.mdx index 6deec501d..ccf58c71c 100644 --- a/docs/android-core/participants/events.mdx +++ b/docs/android-core/participants/events.mdx @@ -302,3 +302,184 @@ Triggers an event when there is any change in active participants list in the me + +## 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 + private val participantUpdateListener = object : DyteParticipantUpdateListener { + override fun onUpdate(participant: DyteRemoteParticipant) { + // your code here to handle participant update + } + } + ``` + + + + + + ```java + 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 + private val participantUpdateListener = object : DyteParticipantUpdateListener { + override fun onVideoUpdate(participant: DyteRemoteParticipant, isEnabled: Boolean) { + } + } +``` + + + + + +```java + DyteParticipantUpdateListener participantUpdateListener = new DyteParticipantUpdateListener() { + @Override + public void onVideoUpdate(DyteRemoteParticipant participant, boolean isEnabled) { + } + } +``` + + + + + + +### Audio update + +Triggers an event when the participant starts / stops audio. + + + + +```kotlin + private val participantUpdateListener = object : DyteParticipantUpdateListener { + override fun onAudioUpdate(participant: DyteRemoteParticipant, isEnabled: Boolean) { + // your code here to handle participant audio toggle update + } + } +``` + + + + + +```java + 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 + 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 + } + } +``` + + + + + +```java + 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 + 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 + } + } +``` + + + + + +```java + 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 + } + } +``` + + + From c04a8d9b0ce25b18332d4f0a91db46429da95205 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Mon, 6 Jan 2025 15:22:18 +0530 Subject: [PATCH 6/6] fix: document the behavior change of `active` list --- docs/android-core/participants/remote-participants.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/android-core/participants/remote-participants.mdx b/docs/android-core/participants/remote-participants.mdx index 07953fd56..4920d6a7b 100644 --- a/docs/android-core/participants/remote-participants.mdx +++ b/docs/android-core/participants/remote-participants.mdx @@ -45,7 +45,7 @@ The `meeting.participants` object has the following **lists** of participants except the local user - **waitlisted**: A list that contains all the participants waiting to join the meeting. -- **active**: A list that contains all the participants, **including** the local user whose media is subscribed to i.e participants who are supposed to be on the screen at the moment, including the local user. +- **active**: A list that contains all the participants, **excluding** the local user whose media is subscribed to i.e participants who are supposed to be on the screen at the moment, except the local user. - **pinned**: A list that contains all the pinned participants of the meeting. - **screenShares**: A list that contains all the participants who are sharing their screen.