Adds optional parameter to addParticipantContainer, make possible to create the SmallVideo outside VideoLayout and pass it to be displayed.

This commit is contained in:
damencho 2016-03-15 13:18:57 -05:00
parent 15865c3d42
commit 3fc839cb37
1 changed files with 10 additions and 8 deletions

View File

@ -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 <tt>true</tt> if the peer container exists,
* <tt>false</tt> - 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];