diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js index 339419f51..5f192f00e 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} - 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. *