浏览代码

Improves safe checks for missing stats.

j8
damencho 8 年前
父节点
当前提交
39a8681e8e
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4
    4
      modules/UI/videolayout/ConnectionIndicator.js

+ 4
- 4
modules/UI/videolayout/ConnectionIndicator.js 查看文件

64
 ConnectionIndicator.prototype.generateText = function () {
64
 ConnectionIndicator.prototype.generateText = function () {
65
     var downloadBitrate, uploadBitrate, packetLoss, i;
65
     var downloadBitrate, uploadBitrate, packetLoss, i;
66
 
66
 
67
-    if(this.bitrate === null) {
67
+    if(!this.bitrate) {
68
         downloadBitrate = "N/A";
68
         downloadBitrate = "N/A";
69
         uploadBitrate = "N/A";
69
         uploadBitrate = "N/A";
70
     }
70
     }
75
             this.bitrate.upload? this.bitrate.upload + " Kbps" : "N/A";
75
             this.bitrate.upload? this.bitrate.upload + " Kbps" : "N/A";
76
     }
76
     }
77
 
77
 
78
-    if(this.packetLoss === null) {
78
+    if(!this.packetLoss) {
79
         packetLoss = "N/A";
79
         packetLoss = "N/A";
80
     } else {
80
     } else {
81
 
81
 
132
 
132
 
133
     if (this.showMoreValue) {
133
     if (this.showMoreValue) {
134
         var downloadBandwidth, uploadBandwidth, transport;
134
         var downloadBandwidth, uploadBandwidth, transport;
135
-        if (this.bandwidth === null) {
135
+        if (!this.bandwidth) {
136
             downloadBandwidth = "N/A";
136
             downloadBandwidth = "N/A";
137
             uploadBandwidth = "N/A";
137
             uploadBandwidth = "N/A";
138
         } else {
138
         } else {
341
  */
341
  */
342
 ConnectionIndicator.prototype.updateConnectionQuality =
342
 ConnectionIndicator.prototype.updateConnectionQuality =
343
     function (percent, object) {
343
     function (percent, object) {
344
-    if (percent === null) {
344
+    if (!percent) {
345
         this.connectionIndicatorContainer.style.display = "none";
345
         this.connectionIndicatorContainer.style.display = "none";
346
         this.popover.forceHide();
346
         this.popover.forceHide();
347
         return;
347
         return;

正在加载...
取消
保存