Skip to content

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

feat(iFrame): add a method for getting the participants info

Jaya Allamsetty8dbe3e37b90a
diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js
index 339419f519..5f192f00e6 100644
--- a/modules/API/external/external_api.js
+++ b/modules/API/external/external_api.js
@@ -358,6 +358,19 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
);
}
+ /**
+ * Returns the formatted display name of a participant.
+ *
+ * @param {string} participantId - The id of the participant.
+ * @returns {string} The formatted display name.
+ */
+ _getFormattedDisplayName(participantId) {
+ const { formattedDisplayName }
+ = this._participants[participantId] || {};
+
+ return formattedDisplayName;
+ }
+
/**
* Returns the id of the on stage participant.
*
@@ -702,6 +715,23 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
return getCurrentDevices(this._transport);
}
+ /**
+ * Returns the conference participants information.
+ *
+ * @returns {Array<Object>} - Returns an array containing participants
+ * information like participant id, display name, avatar URL and email.
+ */
+ getParticipantsInfo() {
+ const participantIds = Object.keys(this._participants);
+ const participantsInfo = Object.values(this._participants);
+
+ participantsInfo.forEach((participant, idx) => {
+ participant.participantId = participantIds[idx];
+ });
+
+ return participantsInfo;
+ }
+
/**
* Returns the current video quality setting.
*
@@ -831,19 +861,6 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
return email;
}
- /**
- * Returns the formatted display name of a participant.
- *
- * @param {string} participantId - The id of the participant.
- * @returns {string} The formatted display name.
- */
- _getFormattedDisplayName(participantId) {
- const { formattedDisplayName }
- = this._participants[participantId] || {};
-
- return formattedDisplayName;
- }
-
/**
* Returns the iframe that loads Jitsi Meet.
*