Skip to content

Commit 5992b28

Browse files
author
dimaspirit
committed
changes after review
1 parent 8131c5a commit 5992b28

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

js/modules/webrtc/qbRTCPeerConnection.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,11 @@ RTCPeerConnection.prototype._getStatsWrap = function() {
246246
selector = self.delegate.callType == 1 ? self.getLocalStreams()[0].getVideoTracks()[0] : self.getLocalStreams()[0].getAudioTracks()[0],
247247
statsReportInterval = 0;
248248

249-
if (config.webrtc && config.webrtc.statsReportTimeInterval && isNaN(+config.webrtc.statsReportTimeInterval)) {
249+
if (!config.webrtc && !config.webrtc.statsReportTimeInterval) {
250+
return;
251+
}
252+
253+
if (isNaN(+config.webrtc.statsReportTimeInterval)) {
250254
Helpers.traceError('statsReportTimeInterval (' + config.webrtc.statsReportTimeInterval + ') must be integer.');
251255
return;
252256
}
@@ -259,13 +263,7 @@ RTCPeerConnection.prototype._getStatsWrap = function() {
259263
var res = results[i],
260264
is_firefox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
261265

262-
/** for firefox */
263-
if(is_firefox && res.type == 'inboundrtp') {
264-
self.delegate._onCallStatsReport(self.userID, res);
265-
}
266-
267-
/** for chrome */
268-
if (res.googCodecName == 'opus') {
266+
if (res.googCodecName == 'opus' || res.type == 'inboundrtp') {
269267
self.delegate._onCallStatsReport(self.userID, res);
270268
}
271269
}

0 commit comments

Comments
 (0)