constREBUFFER_EVENT_LIMIT=8;// Max number of buffering events before we stop compensating for latency.
constREBUFFER_EVENT_LIMIT=5;// Max number of buffering events before we stop compensating for latency.
constMIN_BUFFER_DURATION=300;// Min duration a buffer event must last to be counted.
constMAX_SPEEDUP_RATE=1.07;// The playback rate when compensating for latency.
constTIMEOUT_DURATION=20_000;// The amount of time we stop handling latency after certain events.
@ -24,7 +24,7 @@ const REQUIRED_BANDWIDTH_RATIO = 2.0; // The player:bitrate ratio required to en
@@ -24,7 +24,7 @@ const REQUIRED_BANDWIDTH_RATIO = 2.0; // The player:bitrate ratio required to en
classLatencyCompensator{
constructor(player){
this.player=player;
this.enabled=true;
this.enabled=false;
this.running=false;
this.inTimeout=false;
this.timeoutTimer=0;
@ -64,13 +64,24 @@ class LatencyCompensator {
@@ -64,13 +64,24 @@ class LatencyCompensator {