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.
This commit is contained in:
damencho 2016-11-23 15:35:03 -06:00
parent 71c27f308c
commit 8e6fd0ca95
1 changed files with 6 additions and 0 deletions

View File

@ -358,6 +358,12 @@ var VideoLayout = {
if(smallVideo && smallVideo.hasVideo()) { if(smallVideo && smallVideo.hasVideo()) {
this.updateLargeVideo(currentDominantSpeaker); 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); eventEmitter.emit(UIEvents.PINNED_ENDPOINT, smallVideo, false);