hls.js 1.5.9-0.canary.10265 → 1.5.9-0.canary.10268

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hls.light.js CHANGED
@@ -606,7 +606,7 @@
606
606
  // Some browsers don't allow to use bind on console object anyway
607
607
  // fallback to default if needed
608
608
  try {
609
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.9-0.canary.10265");
609
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.9-0.canary.10268");
610
610
  } catch (e) {
611
611
  /* log fn threw an exception. All logger methods are no-ops. */
612
612
  return createLogger();
@@ -12824,11 +12824,14 @@
12824
12824
  var fragmentTracker = this.fragmentTracker;
12825
12825
  var fragState = fragmentTracker.getState(frag);
12826
12826
  if (fragState === FragmentState.APPENDING) {
12827
- // Lower the buffer size and try again
12827
+ // Lower the max buffer length and try again
12828
12828
  var playlistType = frag.type;
12829
12829
  var bufferedInfo = this.getFwdBufferInfo(this.mediaBuffer, playlistType);
12830
12830
  var minForwardBufferLength = Math.max(frag.duration, bufferedInfo ? bufferedInfo.len : this.config.maxBufferLength);
12831
- if (this.reduceMaxBufferLength(minForwardBufferLength)) {
12831
+ // If backtracking, always remove from the tracker without reducing max buffer length
12832
+ var backtrackFragment = this.backtrackFragment;
12833
+ var backtracked = backtrackFragment ? frag.sn - backtrackFragment.sn : 0;
12834
+ if (backtracked === 1 || this.reduceMaxBufferLength(minForwardBufferLength)) {
12832
12835
  fragmentTracker.removeFragment(frag);
12833
12836
  }
12834
12837
  } else if (((_this$mediaBuffer = this.mediaBuffer) == null ? void 0 : _this$mediaBuffer.buffered.length) === 0) {
@@ -13329,10 +13332,11 @@
13329
13332
  _proto.reduceMaxBufferLength = function reduceMaxBufferLength(threshold) {
13330
13333
  var config = this.config;
13331
13334
  var minLength = threshold || config.maxBufferLength;
13332
- if (config.maxMaxBufferLength >= minLength) {
13335
+ var reducedLength = config.maxMaxBufferLength / 2;
13336
+ if (reducedLength >= minLength) {
13333
13337
  // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...
13334
- config.maxMaxBufferLength /= 2;
13335
- this.warn("Reduce max buffer length to " + config.maxMaxBufferLength + "s");
13338
+ config.maxMaxBufferLength = reducedLength;
13339
+ this.warn("Reduce max buffer length to " + reducedLength + "s");
13336
13340
  return true;
13337
13341
  }
13338
13342
  return false;
@@ -21715,7 +21719,7 @@
21715
21719
  * Get the video-dev/hls.js package version.
21716
21720
  */
21717
21721
  function get() {
21718
- return "1.5.9-0.canary.10265";
21722
+ return "1.5.9-0.canary.10268";
21719
21723
  }
21720
21724
  }, {
21721
21725
  key: "Events",