|
|
@@ -310,6 +310,7 @@ var VideoLayout = (function (my) {
|
|
310
|
310
|
connection.emuc.findJidFromResource(
|
|
311
|
311
|
largeVideoState.userResourceJid));
|
|
312
|
312
|
}
|
|
|
313
|
+
|
|
313
|
314
|
};
|
|
314
|
315
|
|
|
315
|
316
|
my.handleVideoThumbClicked = function(videoSrc,
|
|
|
@@ -318,7 +319,7 @@ var VideoLayout = (function (my) {
|
|
318
|
319
|
// Restore style for previously focused video
|
|
319
|
320
|
var oldContainer = null;
|
|
320
|
321
|
if(focusedVideoInfo) {
|
|
321
|
|
- var focusResourceJid = focusedVideoInfo.resouceJid;
|
|
|
322
|
+ var focusResourceJid = focusedVideoInfo.resourceJid;
|
|
322
|
323
|
oldContainer = getParticipantContainer(focusResourceJid);
|
|
323
|
324
|
}
|
|
324
|
325
|
|
|
|
@@ -354,7 +355,7 @@ var VideoLayout = (function (my) {
|
|
354
|
355
|
// Lock new video
|
|
355
|
356
|
focusedVideoInfo = {
|
|
356
|
357
|
src: videoSrc,
|
|
357
|
|
- resouceJid: resourceJid
|
|
|
358
|
+ resourceJid: resourceJid
|
|
358
|
359
|
};
|
|
359
|
360
|
|
|
360
|
361
|
// Update focused/pinned interface.
|
|
|
@@ -368,7 +369,8 @@ var VideoLayout = (function (my) {
|
|
368
|
369
|
}
|
|
369
|
370
|
}
|
|
370
|
371
|
|
|
371
|
|
- if ($('#largeVideo').attr('src') === videoSrc) {
|
|
|
372
|
+ if ($('#largeVideo').attr('src') === videoSrc &&
|
|
|
373
|
+ VideoLayout.isLargeVideoOnTop()) {
|
|
372
|
374
|
return;
|
|
373
|
375
|
}
|
|
374
|
376
|
|
|
|
@@ -433,15 +435,18 @@ var VideoLayout = (function (my) {
|
|
433
|
435
|
$('#largeVideo').css({visibility: 'hidden'});
|
|
434
|
436
|
$('.watermark').css({visibility: 'hidden'});
|
|
435
|
437
|
VideoLayout.enableDominantSpeaker(resourceJid, false);
|
|
436
|
|
- var focusJid = VideoLayout.getLargeVideoState().userJid;
|
|
437
|
|
- var oldContainer = getParticipantContainer(focusJid);
|
|
|
438
|
+ if(focusedVideoInfo) {
|
|
|
439
|
+ var focusResourceJid = focusedVideoInfo.resourceJid;
|
|
|
440
|
+ var oldContainer = getParticipantContainer(focusResourceJid);
|
|
438
|
441
|
|
|
439
|
|
- if (oldContainer) {
|
|
440
|
|
- oldContainer.removeClass("videoContainerFocused");
|
|
441
|
|
- }
|
|
442
|
|
- focusedVideoInfo = null;
|
|
443
|
|
- if(focusJid) {
|
|
444
|
|
- Avatar.showUserAvatar(focusJid);
|
|
|
442
|
+ if (oldContainer && oldContainer.length > 0) {
|
|
|
443
|
+ oldContainer.removeClass("videoContainerFocused");
|
|
|
444
|
+ }
|
|
|
445
|
+ focusedVideoInfo = null;
|
|
|
446
|
+ if(focusResourceJid) {
|
|
|
447
|
+ Avatar.showUserAvatar(
|
|
|
448
|
+ connection.emuc.findJidFromResource(focusResourceJid));
|
|
|
449
|
+ }
|
|
445
|
450
|
}
|
|
446
|
451
|
}
|
|
447
|
452
|
};
|
|
|
@@ -455,6 +460,10 @@ var VideoLayout = (function (my) {
|
|
455
|
460
|
return $('#largeVideo').is(':visible');
|
|
456
|
461
|
};
|
|
457
|
462
|
|
|
|
463
|
+ my.isLargeVideoOnTop = function () {
|
|
|
464
|
+ return !Prezi.isPresentationVisible() && !Etherpad.isVisible();
|
|
|
465
|
+ };
|
|
|
466
|
+
|
|
458
|
467
|
/**
|
|
459
|
468
|
* Checks if container for participant identified by given peerJid exists
|
|
460
|
469
|
* in the document and creates it eventually.
|
|
|
@@ -596,13 +605,14 @@ var VideoLayout = (function (my) {
|
|
596
|
605
|
* no actual video).
|
|
597
|
606
|
*/
|
|
598
|
607
|
var videoThumb = $('#' + container.id + '>video').get(0);
|
|
599
|
|
-
|
|
600
|
|
- if (videoThumb)
|
|
|
608
|
+ if (videoThumb) {
|
|
601
|
609
|
VideoLayout.handleVideoThumbClicked(
|
|
602
|
610
|
RTC.getVideoSrc(videoThumb),
|
|
603
|
611
|
false,
|
|
604
|
612
|
Strophe.getResourceFromJid(peerJid));
|
|
|
613
|
+ }
|
|
605
|
614
|
|
|
|
615
|
+ event.stopPropagation();
|
|
606
|
616
|
event.preventDefault();
|
|
607
|
617
|
return false;
|
|
608
|
618
|
};
|
|
|
@@ -1098,21 +1108,21 @@ var VideoLayout = (function (my) {
|
|
1098
|
1108
|
|
|
1099
|
1109
|
if (video && video.length > 0) {
|
|
1100
|
1110
|
if (isEnable) {
|
|
1101
|
|
- VideoLayout.showDisplayName(videoContainerId, true);
|
|
|
1111
|
+ var isLargeVideoVisible = VideoLayout.isLargeVideoOnTop();
|
|
|
1112
|
+ VideoLayout.showDisplayName(videoContainerId, isLargeVideoVisible);
|
|
1102
|
1113
|
|
|
1103
|
1114
|
if (!videoSpan.classList.contains("dominantspeaker"))
|
|
1104
|
1115
|
videoSpan.classList.add("dominantspeaker");
|
|
1105
|
|
-
|
|
1106
|
|
- video.css({visibility: 'hidden'});
|
|
1107
|
1116
|
}
|
|
1108
|
1117
|
else {
|
|
1109
|
1118
|
VideoLayout.showDisplayName(videoContainerId, false);
|
|
1110
|
1119
|
|
|
1111
|
1120
|
if (videoSpan.classList.contains("dominantspeaker"))
|
|
1112
|
1121
|
videoSpan.classList.remove("dominantspeaker");
|
|
1113
|
|
-
|
|
1114
|
|
- video.css({visibility: 'visible'});
|
|
1115
|
1122
|
}
|
|
|
1123
|
+
|
|
|
1124
|
+ Avatar.showUserAvatar(
|
|
|
1125
|
+ connection.emuc.findJidFromResource(resourceJid));
|
|
1116
|
1126
|
}
|
|
1117
|
1127
|
};
|
|
1118
|
1128
|
|
|
|
@@ -1715,12 +1725,13 @@ var VideoLayout = (function (my) {
|
|
1715
|
1725
|
= VideoLayout.getPeerContainerResourceJid(videoParent[0]);
|
|
1716
|
1726
|
|
|
1717
|
1727
|
// Update the large video to the last added video only if there's no
|
|
1718
|
|
- // current dominant or focused speaker or update it to the current
|
|
1719
|
|
- // dominant speaker.
|
|
1720
|
|
- if ((!focusedVideoInfo && !VideoLayout.getDominantSpeakerResourceJid())
|
|
1721
|
|
- || (parentResourceJid
|
|
1722
|
|
- && VideoLayout.getDominantSpeakerResourceJid()
|
|
1723
|
|
- === parentResourceJid)) {
|
|
|
1728
|
+ // current dominant, focused speaker or prezi playing or update it to
|
|
|
1729
|
+ // the current dominant speaker.
|
|
|
1730
|
+ if ((!focusedVideoInfo &&
|
|
|
1731
|
+ !VideoLayout.getDominantSpeakerResourceJid() &&
|
|
|
1732
|
+ !Prezi.isPresentationVisible()) ||
|
|
|
1733
|
+ (parentResourceJid &&
|
|
|
1734
|
+ VideoLayout.getDominantSpeakerResourceJid() === parentResourceJid)) {
|
|
1724
|
1735
|
VideoLayout.updateLargeVideo(
|
|
1725
|
1736
|
RTC.getVideoSrc(videoelem[0]),
|
|
1726
|
1737
|
1,
|