Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Exposes the number of participants with tracks.

Boris Grozevfb7c2082e6e8
diff --git a/conference.js b/conference.js
index ac89e1f5e2..f046e0191c 100644
--- a/conference.js
+++ b/conference.js
@@ -474,20 +474,13 @@ export default {
return this.audioLevelsMap[id];
},
/**
- * Will check for number of remote particiapnts that have at least one
- * remote track.
- * @return {boolean} whether we have enough participants with remote streams
+ * @return {number} the number of participants in the conference with at
+ * least one track.
*/
- checkEnoughParticipants (number) {
- var participants = this._room.getParticipants();
-
- var foundParticipants = 0;
- for (var i = 0; i < participants.length; i += 1) {
- if (participants[i].getTracks().length > 0) {
- foundParticipants++;
- }
- }
- return foundParticipants >= number;
+ getNumberOfParticipantsWithTracks() {
+ return this._room.getParticipants()
+ .filter((p) => p.getTracks().length > 0)
+ .length;
},
/**
* Returns the stats.