update collapsible

This commit is contained in:
Luke Pulverenti 2016-07-02 14:05:40 -04:00
parent f351643d29
commit 891a865464
42 changed files with 1185 additions and 536 deletions

View file

@ -11,9 +11,9 @@ import EWMA from '../utils/ewma';
class EwmaBandWidthEstimator {
constructor(hls,slow,fast) {
constructor(hls,slow,fast,defaultEstimate) {
this.hls = hls;
this.defaultEstimate_ = 5e5; // 500kbps
this.defaultEstimate_ = defaultEstimate;
this.minWeight_ = 0.001;
this.minDelayMs_ = 50;
this.slow_ = new EWMA(slow);
@ -32,7 +32,7 @@ class EwmaBandWidthEstimator {
getEstimate() {
if (!this.fast_ || this.fast_.getTotalWeight() < this.minWeight_) {
if (!this.fast_ || !this.slow_ || this.fast_.getTotalWeight() < this.minWeight_) {
return this.defaultEstimate_;
}
//console.log('slow estimate:'+ Math.round(this.slow_.getEstimate()));