ref(ConnectionIndicator.js): make CQ 'object' optional

This commit is contained in:
paweldomas 2016-09-16 14:57:56 -05:00
parent cf931f8a9f
commit e9445866a5
1 changed files with 9 additions and 7 deletions

View File

@ -314,6 +314,7 @@ ConnectionIndicator.prototype.updateConnectionQuality =
this.connectionIndicatorContainer.style.display = "block"; this.connectionIndicatorContainer.style.display = "block";
} }
} }
if (object) {
this.bandwidth = object.bandwidth; this.bandwidth = object.bandwidth;
this.bitrate = object.bitrate; this.bitrate = object.bitrate;
this.packetLoss = object.packetLoss; this.packetLoss = object.packetLoss;
@ -321,13 +322,14 @@ ConnectionIndicator.prototype.updateConnectionQuality =
if (object.resolution) { if (object.resolution) {
this.resolution = object.resolution; this.resolution = object.resolution;
} }
}
for (var quality in ConnectionIndicator.connectionQualityValues) { for (var quality in ConnectionIndicator.connectionQualityValues) {
if (percent >= quality) { if (percent >= quality) {
this.fullIcon.style.width = this.fullIcon.style.width =
ConnectionIndicator.connectionQualityValues[quality]; ConnectionIndicator.connectionQualityValues[quality];
} }
} }
if (object.isResolutionHD) { if (object && typeof object.isResolutionHD === 'boolean') {
this.isResolutionHD = object.isResolutionHD; this.isResolutionHD = object.isResolutionHD;
} }
this.updateResolutionIndicator(); this.updateResolutionIndicator();