diff --git a/src/utils/webrtc/analyzers/PeerConnectionAnalyzer.js b/src/utils/webrtc/analyzers/PeerConnectionAnalyzer.js index 426c91e565..ea2c6adf37 100644 --- a/src/utils/webrtc/analyzers/PeerConnectionAnalyzer.js +++ b/src/utils/webrtc/analyzers/PeerConnectionAnalyzer.js @@ -524,14 +524,18 @@ PeerConnectionAnalyzer.prototype = { }, _calculateConnectionQualityAudio() { - return this._calculateConnectionQuality(this._packetsLostRatio.audio, this._packetsPerSecond.audio, this._roundTripTime.audio, 'audio') + return this._calculateConnectionQuality('audio') }, _calculateConnectionQualityVideo() { - return this._calculateConnectionQuality(this._packetsLostRatio.video, this._packetsPerSecond.video, this._roundTripTime.video, 'video') + return this._calculateConnectionQuality('video') }, - _calculateConnectionQuality(packetsLostRatio, packetsPerSecond, roundTripTime, kind) { + _calculateConnectionQuality(kind) { + const packetsLostRatio = this._packetsLostRatio[kind] + const packetsPerSecond = this._packetsPerSecond[kind] + const roundTripTime = this._roundTripTime[kind] + if (!packetsLostRatio.hasEnoughData() || !packetsPerSecond.hasEnoughData()) { return CONNECTION_QUALITY.UNKNOWN }