From 3fc839cb374de5055452cf9c248fc6f5d3e7fba5 Mon Sep 17 00:00:00 2001 From: damencho Date: Tue, 15 Mar 2016 13:18:57 -0500 Subject: [PATCH] Adds optional parameter to addParticipantContainer, make possible to create the SmallVideo outside VideoLayout and pass it to be displayed. --- modules/UI/videolayout/VideoLayout.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js index e1550503e..787835b55 100644 --- a/modules/UI/videolayout/VideoLayout.js +++ b/modules/UI/videolayout/VideoLayout.js @@ -326,16 +326,18 @@ var VideoLayout = { this.updateLargeVideo(resourceJid); }, - /** - * Checks if container for participant identified by given id exists - * in the document and creates it eventually. - * - * @return Returns true if the peer container exists, - * false - otherwise + * Creates a remote video for participant for the given id. + * @param id the id of the participant to add + * @param {SmallVideo} smallVideo optional small video instance to add as a + * remote video, if undefined RemoteVideo will be created */ - addParticipantContainer (id) { - let remoteVideo = new RemoteVideo(id, VideoLayout, eventEmitter); + addParticipantContainer (id, smallVideo) { + let remoteVideo; + if(smallVideo) + remoteVideo = smallVideo; + else + remoteVideo = new RemoteVideo(id, VideoLayout, eventEmitter); remoteVideos[id] = remoteVideo; let videoType = remoteVideoTypes[id];