Browse Source

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

master
yanas 11 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
         var peerStats = statsCollector.jid2stats[jid];
448
         var peerStats = statsCollector.jid2stats[jid];
449
         Object.keys(peerStats.ssrc2AudioLevel).forEach(function (ssrc)
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
  */
462
  */
462
 function localStatsUpdated(statsCollector)
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
             $('#remoteVideos>span').animate({height: thumbnailsHeight,
175
             $('#remoteVideos>span').animate({height: thumbnailsHeight,
176
                                             width: thumbnailsWidth},
176
                                             width: thumbnailsWidth},
177
                                             {queue: false,
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
             $('#largeVideoContainer').animate({ width: videospaceWidth,
186
             $('#largeVideoContainer').animate({ width: videospaceWidth,
181
                                                 height: videospaceHeight},
187
                                                 height: videospaceHeight},
219
             $('#remoteVideos>span').animate({height: thumbnailsHeight,
225
             $('#remoteVideos>span').animate({height: thumbnailsHeight,
220
                         width: thumbnailsWidth},
226
                         width: thumbnailsWidth},
221
                         {queue: false,
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
             $('#largeVideoContainer').animate({ width: videospaceWidth,
235
             $('#largeVideoContainer').animate({ width: videospaceWidth,
225
                                                 height: videospaceHeight},
236
                                                 height: videospaceHeight},

+ 1
- 1
config.js View File

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

+ 17
- 2
css/videolayout_default.css View File

49
     -webkit-animation-name: greyPulse;
49
     -webkit-animation-name: greyPulse;
50
     -webkit-animation-duration: 2s;
50
     -webkit-animation-duration: 2s;
51
     -webkit-animation-iteration-count: 1;
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
 #localVideoWrapper {
64
 #localVideoWrapper {
291
     background-image:url(../images/rightwatermark.png);
299
     background-image:url(../images/rightwatermark.png);
292
     background-position: center right;
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
     <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
22
     <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
23
     <script src="libs/tooltip.js?v=1"></script><!-- bootstrap tooltip lib -->
23
     <script src="libs/tooltip.js?v=1"></script><!-- bootstrap tooltip lib -->
24
     <script src="libs/popover.js?v=1"></script><!-- bootstrap tooltip lib -->
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
     <script src="muc.js?v=12"></script><!-- simple MUC library -->
26
     <script src="muc.js?v=12"></script><!-- simple MUC library -->
27
     <script src="estos_log.js?v=2"></script><!-- simple stanza logger -->
27
     <script src="estos_log.js?v=2"></script><!-- simple stanza logger -->
28
     <script src="desktopsharing.js?v=2"></script><!-- desktop sharing -->
28
     <script src="desktopsharing.js?v=2"></script><!-- desktop sharing -->
29
     <script src="data_channels.js?v=2"></script><!-- data channels -->
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
     <script src="commands.js?v=1"></script><!-- application logic -->
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
     <script src="util.js?v=5"></script><!-- utility functions -->
33
     <script src="util.js?v=5"></script><!-- utility functions -->
34
     <script src="etherpad.js?v=8"></script><!-- etherpad plugin -->
34
     <script src="etherpad.js?v=8"></script><!-- etherpad plugin -->
35
     <script src="prezi.js?v=4"></script><!-- prezi plugin -->
35
     <script src="prezi.js?v=4"></script><!-- prezi plugin -->
39
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
39
     <script src="analytics.js?v=1"></script><!-- google analytics plugin -->
40
     <script src="rtp_stats.js?v=1"></script><!-- RTP stats processing -->
40
     <script src="rtp_stats.js?v=1"></script><!-- RTP stats processing -->
41
     <script src="local_stats.js?v=1"></script><!-- Local stats processing -->
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
     <script src="toolbar.js?v=3"></script><!-- toolbar ui -->
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
     <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
46
     <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
45
     <link rel="stylesheet" href="css/font.css"/>
47
     <link rel="stylesheet" href="css/font.css"/>
46
     <link rel="stylesheet" type="text/css" media="screen" href="css/main.css?v=22"/>
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
     <link rel="stylesheet" href="css/jquery-impromptu.css?v=4">
50
     <link rel="stylesheet" href="css/jquery-impromptu.css?v=4">
49
     <link rel="stylesheet" href="css/modaldialog.css?v=3">
51
     <link rel="stylesheet" href="css/modaldialog.css?v=3">
50
     <link rel="stylesheet" href="css/popup_menu.css?v=2">
52
     <link rel="stylesheet" href="css/popup_menu.css?v=2">

+ 3
- 6
local_stats.js View File

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

+ 8
- 0
videolayout.js View File

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

Loading…
Cancel
Save