From 24f9a1c8d1658feaae6dab12561d9e0c042967cc Mon Sep 17 00:00:00 2001 From: Boris Grozev Date: Tue, 28 Jul 2015 12:50:26 -0500 Subject: [PATCH] Abstract browser type checks. --- modules/statistics/RTPStatsCollector.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/statistics/RTPStatsCollector.js b/modules/statistics/RTPStatsCollector.js index e2b7988a5..5b59638d6 100644 --- a/modules/statistics/RTPStatsCollector.js +++ b/modules/statistics/RTPStatsCollector.js @@ -1,8 +1,10 @@ -/* global ssrc2jid */ +/* global require, ssrc2jid */ /* jshint -W117 */ var RTCBrowserType = require("../RTC/RTCBrowserType"); - +/* Whether we support the browser we are running into for logging statistics */ +var browserSupported = RTCBrowserType.isChrome() || + RTCBrowserType.isChrome(); /** * Calculates packet lost percent using the number of lost packets and the * number of all packet. @@ -260,7 +262,7 @@ StatsCollector.prototype.start = function () ); } - if(!config.disableStats && !navigator.mozGetUserMedia) { + if (!config.disableStats && browserSupported) { this.statsIntervalId = setInterval( function () { // Interval updates @@ -294,7 +296,7 @@ StatsCollector.prototype.start = function () ); } - if (config.logStats && !navigator.mozGetUserMedia) { + if (config.logStats && browserSupported) { this.gatherStatsIntervalId = setInterval( function () { self.peerconnection.getStats(