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(conference.js): add isParticipantConnectionActive

paweldomas5daceaead723
diff --git a/conference.js b/conference.js
index 66865a1881..9c18b06fc6 100644
--- a/conference.js
+++ b/conference.js
@@ -691,6 +691,29 @@ export default {
isConnectionInterrupted () {
return connectionIsInterrupted;
},
+ /**
+ * Finds JitsiParticipant for given id.
+ *
+ * @param {string} id participant's identifier(MUC nickname).
+ *
+ * @returns {JitsiParticipant|null} participant instance for given id or
+ * null if not found.
+ */
+ getParticipantById (id) {
+ return room ? room.getParticipantById(id) : null;
+ },
+ /**
+ * Checks whether the user identified by given id is currently connected.
+ *
+ * @param {string} id participant's identifier(MUC nickname)
+ *
+ * @returns {boolean|null} true if participant's connection is ok or false
+ * if the user is having connectivity issues.
+ */
+ isParticipantConnectionActive (id) {
+ let participant = this.getParticipantById(id);
+ return participant ? participant.isConnectionActive() : null;
+ },
getMyUserId () {
return this._room
&& this._room.myUserId();