|
|
|
@ -11,6 +11,7 @@ class PlaybackMetrics { |
|
|
|
this.errors = 0; |
|
|
|
this.errors = 0; |
|
|
|
this.qualityVariantChanges = 0; |
|
|
|
this.qualityVariantChanges = 0; |
|
|
|
this.isBuffering = false; |
|
|
|
this.isBuffering = false; |
|
|
|
|
|
|
|
this.bufferingDurationTimer = 0; |
|
|
|
|
|
|
|
|
|
|
|
setInterval(() => { |
|
|
|
setInterval(() => { |
|
|
|
this.send(); |
|
|
|
this.send(); |
|
|
|
@ -31,6 +32,19 @@ class PlaybackMetrics { |
|
|
|
this.qualityVariantChanges++; |
|
|
|
this.qualityVariantChanges++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setIsBuffering(isBuffering) { |
|
|
|
|
|
|
|
this.isBuffering = isBuffering; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!isBuffering) { |
|
|
|
|
|
|
|
clearTimeout(this.bufferingDurationTimer); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.bufferingDurationTimer = setTimeout(() => { |
|
|
|
|
|
|
|
this.incrementErrorCount(1); |
|
|
|
|
|
|
|
}, 500); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
trackSegmentDownloadTime(seconds) { |
|
|
|
trackSegmentDownloadTime(seconds) { |
|
|
|
this.segmentDownloadTime.push(seconds); |
|
|
|
this.segmentDownloadTime.push(seconds); |
|
|
|
} |
|
|
|
} |
|
|
|
|