|
@@ -199,23 +199,22 @@ var VideoLayout = {
|
199
|
199
|
/**
|
200
|
200
|
* Checks if removed video is currently displayed and tries to display
|
201
|
201
|
* another one instead.
|
|
202
|
+ * Uses focusedID if any or dominantSpeakerID if any,
|
|
203
|
+ * otherwise elects new video, in this order.
|
202
|
204
|
*/
|
203
|
|
- updateRemovedVideo (id) {
|
|
205
|
+ updateAfterThumbRemoved (id) {
|
204
|
206
|
if (!this.isCurrentlyOnLarge(id)) {
|
205
|
207
|
return;
|
206
|
208
|
}
|
207
|
209
|
|
208
|
210
|
let newId;
|
209
|
211
|
|
210
|
|
- // We'll show user's avatar if he is the dominant speaker or if
|
211
|
|
- // his video thumbnail is pinned
|
212
|
|
- if (remoteVideos[id] && (id === pinnedId
|
213
|
|
- || id === currentDominantSpeaker)) {
|
214
|
|
- newId = id;
|
215
|
|
- } else {
|
216
|
|
- // Otherwise select last visible video
|
|
212
|
+ if (pinnedId)
|
|
213
|
+ newId = pinnedId;
|
|
214
|
+ else if (currentDominantSpeaker)
|
|
215
|
+ newId = currentDominantSpeaker;
|
|
216
|
+ else // Otherwise select last visible video
|
217
|
217
|
newId = this.electLastVisibleVideo();
|
218
|
|
- }
|
219
|
218
|
|
220
|
219
|
this.updateLargeVideo(newId);
|
221
|
220
|
},
|
|
@@ -304,8 +303,7 @@ var VideoLayout = {
|
304
|
303
|
*/
|
305
|
304
|
handleVideoThumbClicked (id) {
|
306
|
305
|
if(pinnedId) {
|
307
|
|
- var oldSmallVideo
|
308
|
|
- = VideoLayout.getSmallVideo(pinnedId);
|
|
306
|
+ var oldSmallVideo = VideoLayout.getSmallVideo(pinnedId);
|
309
|
307
|
if (oldSmallVideo && !interfaceConfig.filmStripOnly)
|
310
|
308
|
oldSmallVideo.focus(false);
|
311
|
309
|
}
|
|
@@ -978,8 +976,18 @@ var VideoLayout = {
|
978
|
976
|
var oldSmallVideo = this.getSmallVideo(currentId);
|
979
|
977
|
}
|
980
|
978
|
|
981
|
|
- // if !show then use default type - large video
|
982
|
|
- return largeVideo.showContainer(show ? type : VIDEO_CONTAINER_TYPE)
|
|
979
|
+ let containerTypeToShow = type;
|
|
980
|
+ // if we are hiding a container and there is focusedVideo
|
|
981
|
+ // (pinned remote video) use its video type,
|
|
982
|
+ // if not then use default type - large video
|
|
983
|
+ if (!show) {
|
|
984
|
+ if(pinnedId)
|
|
985
|
+ containerTypeToShow = this.getRemoteVideoType(pinnedId);
|
|
986
|
+ else
|
|
987
|
+ containerTypeToShow = VIDEO_CONTAINER_TYPE;
|
|
988
|
+ }
|
|
989
|
+
|
|
990
|
+ return largeVideo.showContainer(containerTypeToShow)
|
983
|
991
|
.then(() => {
|
984
|
992
|
if(oldSmallVideo)
|
985
|
993
|
oldSmallVideo && oldSmallVideo.updateView();
|