From e330dbf5d13ad3394033a2df59edf35eca3c4fee Mon Sep 17 00:00:00 2001 From: damencho Date: Tue, 22 Mar 2016 16:12:25 -0500 Subject: [PATCH] Fixes switching to pinned video when hiding a container. --- modules/UI/videolayout/VideoLayout.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js index f73ae3e1b..add0f9ea1 100644 --- a/modules/UI/videolayout/VideoLayout.js +++ b/modules/UI/videolayout/VideoLayout.js @@ -978,8 +978,19 @@ var VideoLayout = { var oldSmallVideo = this.getSmallVideo(currentId); } - // if !show then use default type - large video - return largeVideo.showContainer(show ? type : VIDEO_CONTAINER_TYPE) + let containerTypeToShow = type; + // if we are hiding a container and there is focusedVideo + // (pinned remote video) use its video type, + // if not then use default type - large video + if (!show) { + if(focusedVideoResourceJid) + containerTypeToShow = this.getRemoteVideoType( + focusedVideoResourceJid); + else + containerTypeToShow = VIDEO_CONTAINER_TYPE; + } + + return largeVideo.showContainer(containerTypeToShow) .then(() => { if(oldSmallVideo) oldSmallVideo && oldSmallVideo.updateView();