Skip to content

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

Get participant specific video element

Jip-Hop2c70388a9e2c
diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.js
index 0a4aa9eac9..a089d27aec 100644
--- a/modules/API/external/external_api.js
+++ b/modules/API/external/external_api.js
@@ -366,6 +366,30 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
return iframe.contentWindow.document.getElementById('largeVideo');
}
+ /**
+ * Getter for participant specific video element in Jitsi Meet.
+ *
+ * @param {string|undefined} participantId - Id of participant to return the video for.
+ *
+ * @returns {HTMLElement|undefined} - The requested video. Will return the local video
+ * by default if participantId is undefined.
+ */
+ _getParticipantVideo(participantId) {
+ const iframe = this.getIFrame();
+
+ if (!iframe
+ || !iframe.contentWindow
+ || !iframe.contentWindow.document) {
+ return;
+ }
+
+ if (typeof participantId === 'undefined' || participantId === this._myUserID) {
+ return iframe.contentWindow.document.getElementById('localVideo_container');
+ }
+
+ return iframe.contentWindow.document.querySelector(`#participant_${participantId} video`);
+ }
+
/**
* Sets the size of the iframe element.
*