Browse Source

Abstract browser type checks.

master
Boris Grozev 10 years ago
parent
commit
24f9a1c8d1
1 changed files with 6 additions and 4 deletions
  1. 6
    4
      modules/statistics/RTPStatsCollector.js

+ 6
- 4
modules/statistics/RTPStatsCollector.js View File

1
-/* global ssrc2jid */
1
+/* global require, ssrc2jid */
2
 /* jshint -W117 */
2
 /* jshint -W117 */
3
 var RTCBrowserType = require("../RTC/RTCBrowserType");
3
 var RTCBrowserType = require("../RTC/RTCBrowserType");
4
 
4
 
5
-
5
+/* Whether we support the browser we are running into for logging statistics */
6
+var browserSupported = RTCBrowserType.isChrome() ||
7
+    RTCBrowserType.isChrome();
6
 /**
8
 /**
7
  * Calculates packet lost percent using the number of lost packets and the
9
  * Calculates packet lost percent using the number of lost packets and the
8
  * number of all packet.
10
  * number of all packet.
260
         );
262
         );
261
     }
263
     }
262
 
264
 
263
-    if(!config.disableStats && !navigator.mozGetUserMedia) {
265
+    if (!config.disableStats && browserSupported) {
264
         this.statsIntervalId = setInterval(
266
         this.statsIntervalId = setInterval(
265
             function () {
267
             function () {
266
                 // Interval updates
268
                 // Interval updates
294
         );
296
         );
295
     }
297
     }
296
 
298
 
297
-    if (config.logStats && !navigator.mozGetUserMedia) {
299
+    if (config.logStats && browserSupported) {
298
         this.gatherStatsIntervalId = setInterval(
300
         this.gatherStatsIntervalId = setInterval(
299
             function () {
301
             function () {
300
                 self.peerconnection.getStats(
302
                 self.peerconnection.getStats(

Loading…
Cancel
Save