Browse Source

Get attributes based on kind instead of explictly pass them

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
pull/5885/head
Daniel Calviño Sánchez 4 years ago
parent
commit
b196b8d339
  1. 10
      src/utils/webrtc/analyzers/PeerConnectionAnalyzer.js

10
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
}

Loading…
Cancel
Save