Pārlūkot izejas kodu

Fixes bugs with thumbnails getting black when prezi is playing or etherpad is viewed.

master
fo 11 gadus atpakaļ
vecāks
revīzija
f0a4c08f26
5 mainītis faili ar 66 papildinājumiem un 47 dzēšanām
  1. 3
    2
      avatar.js
  2. 1
    2
      css/videolayout_default.css
  3. 16
    10
      etherpad.js
  4. 11
    9
      prezi.js
  5. 35
    24
      videolayout.js

+ 3
- 2
avatar.js Parādīt failu

@@ -73,8 +73,9 @@ var Avatar = (function(my) {
73 73
             }
74 74
 
75 75
             //if the user is the currently focused, the dominant speaker or if
76
-            //there is no focused and no dominant speaker
77
-            if (activeSpeakerJid === jid) {
76
+            //there is no focused and no dominant speaker and the large video is
77
+            //currently shown
78
+            if (activeSpeakerJid === jid && VideoLayout.isLargeVideoOnTop()) {
78 79
                 setVisibility($("#largeVideo"), !show);
79 80
                 setVisibility($('#activeSpeakerAvatar'), show);
80 81
                 setVisibility(avatar, false);

+ 1
- 2
css/videolayout_default.css Parādīt failu

@@ -36,8 +36,6 @@
36 36
 #remoteVideos .videocontainer {
37 37
     display: inline-block;
38 38
     background-color: black;
39
-    background-repeat: no-repeat;
40
-    background-position: 45;
41 39
     background-size: contain;
42 40
     border-radius:8px;
43 41
     border: 2px solid #212425;
@@ -376,6 +374,7 @@
376 374
     position: absolute;
377 375
     z-index: 0;
378 376
     border-radius:10px;
377
+    pointer-events: none;
379 378
 }
380 379
 
381 380
 #mixedstream {

+ 16
- 10
etherpad.js Parādīt failu

@@ -48,12 +48,12 @@ var Etherpad = (function (my) {
48 48
                 } else {
49 49
                     VideoLayout.setLargeVideoVisible(false);
50 50
                 }
51
+            });
51 52
 
52
-                $('#etherpad>iframe').fadeIn(300, function () {
53
-                    document.body.style.background = '#eeeeee';
54
-                    $('#etherpad>iframe').css({visibility: 'visible'});
55
-                    $('#etherpad').css({zIndex: 2});
56
-                });
53
+            $('#etherpad>iframe').fadeIn(300, function () {
54
+                document.body.style.background = '#eeeeee';
55
+                $('#etherpad>iframe').css({visibility: 'visible'});
56
+                $('#etherpad').css({zIndex: 2});
57 57
             });
58 58
         }
59 59
         else if ($('#etherpad>iframe')) {
@@ -61,16 +61,22 @@ var Etherpad = (function (my) {
61 61
                 $('#etherpad>iframe').css({visibility: 'hidden'});
62 62
                 $('#etherpad').css({zIndex: 0});
63 63
                 document.body.style.background = 'black';
64
-                if (!isPresentation) {
65
-                    $('#largeVideo').fadeIn(300, function () {
66
-                        VideoLayout.setLargeVideoVisible(true);
67
-                    });
68
-                }
69 64
             });
65
+
66
+            if (!isPresentation) {
67
+                $('#largeVideo').fadeIn(300, function () {
68
+                    VideoLayout.setLargeVideoVisible(true);
69
+                });
70
+            }
70 71
         }
71 72
         resize();
72 73
     };
73 74
 
75
+    my.isVisible = function() {
76
+        var etherpadIframe = $('#etherpad>iframe');
77
+        return etherpadIframe && etherpadIframe.is(':visible');
78
+    };
79
+
74 80
     /**
75 81
      * Resizes the etherpad.
76 82
      */

+ 11
- 9
prezi.js Parādīt failu

@@ -13,23 +13,24 @@ var Prezi = (function (my) {
13 13
      * Shows/hides a presentation.
14 14
      */
15 15
     my.setPresentationVisible = function (visible) {
16
+        var prezi = $('#presentation>iframe');
16 17
         if (visible) {
17 18
             // Trigger the video.selected event to indicate a change in the
18 19
             // large video.
19 20
             $(document).trigger("video.selected", [true]);
20 21
 
21
-            $('#largeVideo').fadeOut(300, function () {
22
+            $('#largeVideo').fadeOut(300);
23
+            prezi.fadeIn(300, function() {
24
+                prezi.css({opacity:'1'});
25
+                ToolbarToggler.dockToolbar(true);
22 26
                 VideoLayout.setLargeVideoVisible(false);
23
-                $('#presentation>iframe').fadeIn(300, function() {
24
-                    $('#presentation>iframe').css({opacity:'1'});
25
-                    ToolbarToggler.dockToolbar(true);
26
-                });
27 27
             });
28
+            $('#activeSpeakerAvatar').css('visibility', 'hidden');
28 29
         }
29 30
         else {
30
-            if ($('#presentation>iframe').css('opacity') == '1') {
31
-                $('#presentation>iframe').fadeOut(300, function () {
32
-                    $('#presentation>iframe').css({opacity:'0'});
31
+            if (prezi.css('opacity') == '1') {
32
+                prezi.fadeOut(300, function () {
33
+                    prezi.css({opacity:'0'});
33 34
                     $('#reloadPresentation').css({display:'none'});
34 35
                     $('#largeVideo').fadeIn(300, function() {
35 36
                         VideoLayout.setLargeVideoVisible(true);
@@ -332,8 +333,9 @@ var Prezi = (function (my) {
332 333
      * On video selected event.
333 334
      */
334 335
     $(document).bind('video.selected', function (event, isPresentation) {
335
-        if (!isPresentation && $('#presentation>iframe'))
336
+        if (!isPresentation && $('#presentation>iframe')) {
336 337
             Prezi.setPresentationVisible(false);
338
+        }
337 339
     });
338 340
 
339 341
     $(window).resize(function () {

+ 35
- 24
videolayout.js Parādīt failu

@@ -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,

Notiek ielāde…
Atcelt
Saglabāt