浏览代码

Fixes positioning issues with connection popover. Fixes some issues with removal of the connection popover.

j8
hristoterezov 11 年前
父节点
当前提交
ee7752dfe2
共有 4 个文件被更改,包括 51 次插入24 次删除
  1. 0
    1
      css/videolayout_default.css
  2. 3
    3
      index.html
  3. 9
    3
      jitsipopover.js
  4. 39
    17
      videolayout.js

+ 0
- 1
css/videolayout_default.css 查看文件

@@ -286,7 +286,6 @@
286 286
     position: absolute;
287 287
     color: #FFFFFF;
288 288
     top: 0;
289
-    right: 23px;
290 289
     padding: 8px 5px;
291 290
     width: 25px;
292 291
     font-size: 8pt;

+ 3
- 3
index.html 查看文件

@@ -47,7 +47,7 @@
47 47
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
48 48
     <script src="rtp_sts.js?v=2"></script><!-- RTP stats processing -->
49 49
     <script src="local_sts.js?v=2"></script><!-- Local stats processing -->
50
-    <script src="videolayout.js?v=16"></script><!-- video ui -->
50
+    <script src="videolayout.js?v=17"></script><!-- video ui -->
51 51
     <script src="connectionquality.js?v=1"></script>
52 52
     <script src="toolbar.js?v=6"></script><!-- toolbar ui -->
53 53
     <script src="toolbar_toggler.js?v=2"></script>
@@ -58,12 +58,12 @@
58 58
     <script src="roomname_generator.js?v=1"></script><!-- generator for random room names -->
59 59
     <script src="keyboard_shortcut.js?v=2"></script>
60 60
     <script src="tracking.js?v=1"></script><!-- tracking -->
61
-    <script src="jitsipopover.js?v=2"></script>
61
+    <script src="jitsipopover.js?v=3"></script>
62 62
     <script src="message_handler.js?v=1"></script>
63 63
     <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
64 64
     <link rel="stylesheet" href="css/font.css?v=4"/>
65 65
     <link rel="stylesheet" type="text/css" media="screen" href="css/main.css?v=26"/>
66
-    <link rel="stylesheet" type="text/css" media="screen" href="css/videolayout_default.css?v=12" id="videolayout_default"/>
66
+    <link rel="stylesheet" type="text/css" media="screen" href="css/videolayout_default.css?v=13" id="videolayout_default"/>
67 67
     <link rel="stylesheet" href="css/jquery-impromptu.css?v=4">
68 68
     <link rel="stylesheet" href="css/modaldialog.css?v=3">
69 69
     <link rel="stylesheet" href="css/popup_menu.css?v=4">

+ 9
- 3
jitsipopover.js 查看文件

@@ -56,12 +56,18 @@ var JitsiPopover = (function () {
56 56
     JitsiPopover.prototype.hide = function () {
57 57
         if(!this.elementIsHovered && !this.popoverIsHovered && this.popoverShown)
58 58
         {
59
-            $(".jitsipopover").remove();
60
-            this.popoverShown = false;
61
-
59
+            this.forceHide();
62 60
         }
63 61
     };
64 62
 
63
+    /**
64
+     * Hides the popover
65
+     */
66
+    JitsiPopover.prototype.forceHide = function () {
67
+        $(".jitsipopover").remove();
68
+        this.popoverShown = false;
69
+    };
70
+
65 71
     /**
66 72
      * Creates the popover html
67 73
      */

+ 39
- 17
videolayout.js 查看文件

@@ -797,12 +797,27 @@ var VideoLayout = (function (my) {
797 797
                     "top");
798 798
                 videoMutedSpan.appendChild(mutedIndicator);
799 799
             }
800
-            var audioMutedSpan = $('#' + videoSpanId + '>span.audioMuted');
801
-            videoMutedSpan = $('#' + videoSpanId + '>span.videoMuted');
802
-            videoMutedSpan.css({right: ((audioMutedSpan.length > 0)?'50px':'30px')});
800
+
801
+            VideoLayout.updateMutePosition(videoSpanId);
802
+
803 803
         }
804 804
     };
805 805
 
806
+    my.updateMutePosition = function (videoSpanId) {
807
+        var audioMutedSpan = $('#' + videoSpanId + '>span.audioMuted');
808
+        var connectionIndicator = $('#' + videoSpanId + '>div.connectionindicator');
809
+        var videoMutedSpan = $('#' + videoSpanId + '>span.videoMuted');
810
+        if(connectionIndicator.length > 0
811
+            && connectionIndicator[0].style.display != "none") {
812
+            audioMutedSpan.css({right: "23px"});
813
+            videoMutedSpan.css({right: ((audioMutedSpan.length > 0? 23 : 0) + 30) + "px"});
814
+        }
815
+        else
816
+        {
817
+            audioMutedSpan.css({right: "0px"});
818
+            videoMutedSpan.css({right: (audioMutedSpan.length > 0? 30 : 0) + "px"});
819
+        }
820
+    }
806 821
     /**
807 822
      * Shows audio muted indicator over small videos.
808 823
      * @param {string} isMuted
@@ -817,19 +832,20 @@ var VideoLayout = (function (my) {
817 832
             }
818 833
         }
819 834
         else {
820
-            if(audioMutedSpan.length > 0 )
821
-                return;
822
-            audioMutedSpan = document.createElement('span');
823
-            audioMutedSpan.className = 'audioMuted';
824
-            Util.setTooltip(audioMutedSpan,
825
-                "Participant is muted",
826
-                "top");
835
+            if(audioMutedSpan.length == 0 ) {
836
+                audioMutedSpan = document.createElement('span');
837
+                audioMutedSpan.className = 'audioMuted';
838
+                Util.setTooltip(audioMutedSpan,
839
+                    "Participant is muted",
840
+                    "top");
827 841
 
828
-            $('#' + videoSpanId)[0].appendChild(audioMutedSpan);
842
+                $('#' + videoSpanId)[0].appendChild(audioMutedSpan);
843
+                var mutedIndicator = document.createElement('i');
844
+                mutedIndicator.className = 'icon-mic-disabled';
845
+                audioMutedSpan.appendChild(mutedIndicator);
829 846
 
830
-            var mutedIndicator = document.createElement('i');
831
-            mutedIndicator.className = 'icon-mic-disabled';
832
-            audioMutedSpan.appendChild(mutedIndicator);
847
+            }
848
+            VideoLayout.updateMutePosition(videoSpanId);
833 849
         }
834 850
     };
835 851
 
@@ -1683,8 +1699,8 @@ var VideoLayout = (function (my) {
1683 1699
      */
1684 1700
     ConnectionIndicator.prototype.remove = function()
1685 1701
     {
1686
-        this.popover.hide();
1687 1702
         this.connectionIndicatorContainer.remove();
1703
+        this.popover.forceHide();
1688 1704
 
1689 1705
     };
1690 1706
 
@@ -1698,11 +1714,15 @@ var VideoLayout = (function (my) {
1698 1714
         if(percent === null)
1699 1715
         {
1700 1716
             this.connectionIndicatorContainer.style.display = "none";
1717
+            this.popover.forceHide();
1701 1718
             return;
1702 1719
         }
1703 1720
         else
1704 1721
         {
1705
-            this.connectionIndicatorContainer.style.display = "block";
1722
+            if(this.connectionIndicatorContainer.style.display == "none") {
1723
+                this.connectionIndicatorContainer.style.display = "block";
1724
+                VideoLayout.updateMutePosition(this.videoContainer.id);
1725
+            }
1706 1726
         }
1707 1727
         this.bandwidth = object.bandwidth;
1708 1728
         this.bitrate = object.bitrate;
@@ -1742,7 +1762,7 @@ var VideoLayout = (function (my) {
1742 1762
      * Hides the popover
1743 1763
      */
1744 1764
     ConnectionIndicator.prototype.hide = function () {
1745
-        this.popover.hide();
1765
+        this.popover.forceHide();
1746 1766
     };
1747 1767
 
1748 1768
     /**
@@ -1750,6 +1770,8 @@ var VideoLayout = (function (my) {
1750 1770
      */
1751 1771
     ConnectionIndicator.prototype.hideIndicator = function () {
1752 1772
         this.connectionIndicatorContainer.style.display = "none";
1773
+        if(this.popover)
1774
+            this.popover.forceHide();
1753 1775
     };
1754 1776
 
1755 1777
     /**

正在加载...
取消
保存