From 8e6fd0ca959114b2f0e8eeaa6fcad4e98048c11a Mon Sep 17 00:00:00 2001 From: damencho Date: Wed, 23 Nov 2016 15:35:03 -0600 Subject: [PATCH] Fixes unpinning local user which is dominant speaker. It was not switching and staying on local video on unpinning, after change the last shown video will be used to switch to it. --- modules/UI/videolayout/VideoLayout.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/UI/videolayout/VideoLayout.js b/modules/UI/videolayout/VideoLayout.js index 65f131387..d24a7447f 100644 --- a/modules/UI/videolayout/VideoLayout.js +++ b/modules/UI/videolayout/VideoLayout.js @@ -358,6 +358,12 @@ var VideoLayout = { if(smallVideo && smallVideo.hasVideo()) { this.updateLargeVideo(currentDominantSpeaker); } + } else { + // if there is no currentDominantSpeaker, it can also be + // that local participant is the dominant speaker + // we should act as a participant has left and was on large + // and we should choose somebody (electLastVisibleVideo) + this.updateLargeVideo(this.electLastVisibleVideo()); } eventEmitter.emit(UIEvents.PINNED_ENDPOINT, smallVideo, false);