Skip to content

Commit

Permalink
Add mechanism to update participant count
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaboleken committed Dec 19, 2024
1 parent 9554d11 commit b4edafb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions react/src/pages/AntMedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,7 @@ function AntMedia(props) {
if (videoTrackAssignmentsIntervalJob === null) {
videoTrackAssignmentsIntervalJob = setInterval(() => {
webRTCAdaptor?.requestVideoTrackAssignments(roomName);
webRTCAdaptor?.getSubtrackCount(roomName, null, null); // get the total participant count in the room
}, 3000);
}
}
Expand Down Expand Up @@ -1528,6 +1529,10 @@ function AntMedia(props) {
}
} else if (info === "subtrackCount") {
if (obj.count !== undefined) {
if (obj.count > participantCount) {
// if the new participant is added, we need to get the subtrack list again
webRTCAdaptor?.getSubtracks(roomName, null, globals.participantListPagination.offset, globals.participantListPagination.pageSize);
}
setParticipantCount(obj.count);
}
} else if (info === "broadcastObject") {
Expand Down

0 comments on commit b4edafb

Please sign in to comment.