|
@@ -435,6 +435,19 @@ var VideoLayout = {
|
435
|
435
|
remoteVideo = new RemoteVideo(user, VideoLayout, eventEmitter);
|
436
|
436
|
this._setRemoteControlProperties(user, remoteVideo);
|
437
|
437
|
this.addRemoteVideoContainer(id, remoteVideo);
|
|
438
|
+
|
|
439
|
+ const remoteVideosCount = Object.keys(remoteVideos).length;
|
|
440
|
+
|
|
441
|
+ if (remoteVideosCount === 1) {
|
|
442
|
+ window.setTimeout(() => {
|
|
443
|
+ const updatedRemoteVideosCount
|
|
444
|
+ = Object.keys(remoteVideos).length;
|
|
445
|
+
|
|
446
|
+ if (updatedRemoteVideosCount === 1 && remoteVideos[id]) {
|
|
447
|
+ this._maybePlaceParticipantOnLargeVideo(id);
|
|
448
|
+ }
|
|
449
|
+ }, 3000);
|
|
450
|
+ }
|
438
|
451
|
},
|
439
|
452
|
|
440
|
453
|
/**
|
|
@@ -465,11 +478,24 @@ var VideoLayout = {
|
465
|
478
|
logger.info(resourceJid + " video is now active", videoElement);
|
466
|
479
|
|
467
|
480
|
VideoLayout.resizeThumbnails(
|
468
|
|
- false, false, function() {$(videoElement).show();});
|
|
481
|
+ false, false, () => {
|
|
482
|
+ if (videoElement) {
|
|
483
|
+ $(videoElement).show();
|
|
484
|
+ }
|
|
485
|
+ });
|
469
|
486
|
|
470
|
|
- // Update the large video to the last added video only if there's no
|
471
|
|
- // current dominant, focused speaker or update it to
|
472
|
|
- // the current dominant speaker.
|
|
487
|
+ this._maybePlaceParticipantOnLargeVideo(resourceJid);
|
|
488
|
+ },
|
|
489
|
+
|
|
490
|
+ /**
|
|
491
|
+ * Update the large video to the last added video only if there's no current
|
|
492
|
+ * dominant, focused speaker or update it to the current dominant speaker.
|
|
493
|
+ *
|
|
494
|
+ * @params {string} resourceJid - The id of the user to maybe display on
|
|
495
|
+ * large video.
|
|
496
|
+ * @returns {void}
|
|
497
|
+ */
|
|
498
|
+ _maybePlaceParticipantOnLargeVideo(resourceJid) {
|
473
|
499
|
if ((!pinnedId &&
|
474
|
500
|
!currentDominantSpeaker &&
|
475
|
501
|
this.isLargeContainerTypeVisible(VIDEO_CONTAINER_TYPE)) ||
|