Browse Source

Audio level indication. Improvements in rollover and active speaker UI. Part 2.

master
yanas 10 years ago
parent
commit
1d3df3c41c
7 changed files with 56 additions and 19 deletions
  1. 7
    3
      app.js
  2. 13
    2
      chat.js
  3. 1
    1
      config.js
  4. 17
    2
      css/videolayout_default.css
  5. 7
    5
      index.html
  6. 3
    6
      local_stats.js
  7. 8
    0
      videolayout.js

+ 7
- 3
app.js View File

@@ -448,8 +448,9 @@ function statsUpdated(statsCollector)
448 448
         var peerStats = statsCollector.jid2stats[jid];
449 449
         Object.keys(peerStats.ssrc2AudioLevel).forEach(function (ssrc)
450 450
         {
451
-//            console.info(jid +  " audio level: " +
452
-//                peerStats.ssrc2AudioLevel[ssrc] + " of ssrc: " + ssrc);
451
+            if (jid !== connection.emuc.myRoomJid)
452
+                AudioLevels.updateAudioLevel(   Strophe.getResourceFromJid(jid),
453
+                                                peerStats.ssrc2AudioLevel[ssrc]);
453 454
         });
454 455
     });
455 456
 }
@@ -461,7 +462,10 @@ function statsUpdated(statsCollector)
461 462
  */
462 463
 function localStatsUpdated(statsCollector)
463 464
 {
464
-//    console.info("Local audio level: " +  statsCollector.audioLevel);
465
+    if (connection.emuc.myRoomJid)
466
+        AudioLevels.updateAudioLevel(
467
+                Strophe.getResourceFromJid(connection.emuc.myRoomJid),
468
+                statsCollector.audioLevel);
465 469
 }
466 470
 
467 471
 /**

+ 13
- 2
chat.js View File

@@ -175,7 +175,13 @@ var Chat = (function (my) {
175 175
             $('#remoteVideos>span').animate({height: thumbnailsHeight,
176 176
                                             width: thumbnailsWidth},
177 177
                                             {queue: false,
178
-                                            duration: 500});
178
+                                            duration: 500,
179
+                                            complete: function() {
180
+                                                $(document).trigger(
181
+                                                        "remotevideo.resized",
182
+                                                        [thumbnailsWidth,
183
+                                                         thumbnailsHeight]);
184
+                                            }});
179 185
 
180 186
             $('#largeVideoContainer').animate({ width: videospaceWidth,
181 187
                                                 height: videospaceHeight},
@@ -219,7 +225,12 @@ var Chat = (function (my) {
219 225
             $('#remoteVideos>span').animate({height: thumbnailsHeight,
220 226
                         width: thumbnailsWidth},
221 227
                         {queue: false,
222
-                        duration: 500});
228
+                        duration: 500,
229
+                        complete: function() {
230
+                            $(document).trigger(
231
+                                    "remotevideo.resized",
232
+                                    [thumbnailsWidth, thumbnailsHeight]);
233
+                        }});
223 234
 
224 235
             $('#largeVideoContainer').animate({ width: videospaceWidth,
225 236
                                                 height: videospaceHeight},

+ 1
- 1
config.js View File

@@ -12,7 +12,7 @@ var config = {
12 12
     desktopSharing: 'ext', // Desktop sharing method. Can be set to 'ext', 'webrtc' or false to disable.
13 13
     chromeExtensionId: 'diibjkoicjeejcmhdnailmkgecihlobk', // Id of desktop streamer Chrome extension
14 14
     minChromeExtVersion: '0.1', // Required version of Chrome extension
15
-    enableRtpStats: false, // Enables RTP stats processing
15
+    enableRtpStats: true, // Enables RTP stats processing
16 16
     openSctp: true, // Toggle to enable/disable SCTP channels
17 17
 //    channelLastN: -1, // The default value of the channel attribute last-n.
18 18
     enableRecording: false

+ 17
- 2
css/videolayout_default.css View File

@@ -49,8 +49,16 @@
49 49
     -webkit-animation-name: greyPulse;
50 50
     -webkit-animation-duration: 2s;
51 51
     -webkit-animation-iteration-count: 1;
52
-    -webkit-box-shadow: 0 0 18px #388396;
53
-    border: 2px solid #388396;
52
+}
53
+
54
+#remoteVideos .videocontainer:hover {
55
+    -webkit-box-shadow: inset 0 0 10px #FFFFFF, 0 0 10px #FFFFFF;
56
+    border: 2px solid #FFFFFF;
57
+}
58
+
59
+#remoteVideos .videocontainer.videoContainerFocused {
60
+    -webkit-box-shadow: inset 0 0 28px #006d91;
61
+    border: 2px solid #006d91;
54 62
 }
55 63
 
56 64
 #localVideoWrapper {
@@ -291,3 +299,10 @@
291 299
     background-image:url(../images/rightwatermark.png);
292 300
     background-position: center right;
293 301
 }
302
+
303
+.audiolevel {
304
+    display: inline-block;
305
+    position: absolute;
306
+    z-index: 0;
307
+    border-radius:10px;
308
+}

+ 7
- 5
index.html View File

@@ -22,14 +22,14 @@
22 22
     <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
23 23
     <script src="libs/tooltip.js?v=1"></script><!-- bootstrap tooltip lib -->
24 24
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
25
-    <script src="config.js?v=2"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
25
+    <script src="config.js?v=3"></script><!-- adapt to your needs, i.e. set hosts and bosh path -->
26 26
     <script src="muc.js?v=12"></script><!-- simple MUC library -->
27 27
     <script src="estos_log.js?v=2"></script><!-- simple stanza logger -->
28 28
     <script src="desktopsharing.js?v=2"></script><!-- desktop sharing -->
29 29
     <script src="data_channels.js?v=2"></script><!-- data channels -->
30
-    <script src="app.js?v=3"></script><!-- application logic -->
30
+    <script src="app.js?v=4"></script><!-- application logic -->
31 31
     <script src="commands.js?v=1"></script><!-- application logic -->
32
-    <script src="chat.js?v=7"></script><!-- chat logic -->
32
+    <script src="chat.js?v=8"></script><!-- chat logic -->
33 33
     <script src="util.js?v=5"></script><!-- utility functions -->
34 34
     <script src="etherpad.js?v=8"></script><!-- etherpad plugin -->
35 35
     <script src="prezi.js?v=4"></script><!-- prezi plugin -->
@@ -39,12 +39,14 @@
39 39
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
40 40
     <script src="rtp_stats.js?v=1"></script><!-- RTP stats processing -->
41 41
     <script src="local_stats.js?v=1"></script><!-- Local stats processing -->
42
-    <script src="videolayout.js?v=6"></script><!-- video ui -->
42
+    <script src="videolayout.js?v=7"></script><!-- video ui -->
43 43
     <script src="toolbar.js?v=3"></script><!-- toolbar ui -->
44
+    <script src="canvas_util.js?v=1"></script><!-- canvas drawing utils -->
45
+    <script src="audio_levels.js?v=1"></script><!-- audio levels plugin -->
44 46
     <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
45 47
     <link rel="stylesheet" href="css/font.css"/>
46 48
     <link rel="stylesheet" type="text/css" media="screen" href="css/main.css?v=22"/>
47
-    <link rel="stylesheet" type="text/css" media="screen" href="css/videolayout_default.css?v=7" id="videolayout_default"/>
49
+    <link rel="stylesheet" type="text/css" media="screen" href="css/videolayout_default.css?v=8" id="videolayout_default"/>
48 50
     <link rel="stylesheet" href="css/jquery-impromptu.css?v=4">
49 51
     <link rel="stylesheet" href="css/modaldialog.css?v=3">
50 52
     <link rel="stylesheet" href="css/popup_menu.css?v=2">

+ 3
- 6
local_stats.js View File

@@ -32,7 +32,6 @@ var LocalStatsCollector = (function() {
32 32
         this.audioLevel = 0;
33 33
     }
34 34
 
35
-
36 35
     /**
37 36
      * Starts the collecting the statistics.
38 37
      */
@@ -61,8 +60,7 @@ var LocalStatsCollector = (function() {
61 60
             },
62 61
             this.intervalMilis
63 62
         );
64
-
65
-    }
63
+    };
66 64
 
67 65
     /**
68 66
      * Stops collecting the statistics.
@@ -72,8 +70,7 @@ var LocalStatsCollector = (function() {
72 70
             clearInterval(this.intervalId);
73 71
             this.intervalId = null;
74 72
         }
75
-    }
76
-
73
+    };
77 74
 
78 75
     /**
79 76
      * Converts frequency data array to audio level.
@@ -91,7 +88,7 @@ var LocalStatsCollector = (function() {
91 88
         }
92 89
 
93 90
         return maxVolume / 255;
94
-    }
91
+    };
95 92
 
96 93
     return LocalStatsCollectorProto;
97 94
 })();

+ 8
- 0
videolayout.js View File

@@ -26,6 +26,8 @@ var VideoLayout = (function (my) {
26 26
         var localVideoContainer = document.getElementById('localVideoWrapper');
27 27
         localVideoContainer.appendChild(localVideo);
28 28
 
29
+        AudioLevels.updateAudioLevelCanvas();
30
+
29 31
         var localVideoSelector = $('#' + localVideo.id);
30 32
         // Add click handler to both video and video wrapper elements in case
31 33
         // there's no video.
@@ -313,6 +315,8 @@ var VideoLayout = (function (my) {
313 315
             addRemoteVideoMenu(peerJid, container);
314 316
 
315 317
         remotes.appendChild(container);
318
+        AudioLevels.updateAudioLevelCanvas(peerJid);
319
+
316 320
         return container;
317 321
     };
318 322
 
@@ -579,6 +583,8 @@ var VideoLayout = (function (my) {
579 583
         $('#remoteVideos').height(height);
580 584
         $('#remoteVideos>span').width(width);
581 585
         $('#remoteVideos>span').height(height);
586
+
587
+        $(document).trigger("remotevideo.resized", [width, height]);
582 588
     };
583 589
 
584 590
     /**
@@ -958,3 +964,5 @@ var VideoLayout = (function (my) {
958 964
 
959 965
     return my;
960 966
 }(VideoLayout || {}));
967
+
968
+    

Loading…
Cancel
Save