hls.js 1.5.9-0.canary.10267 → 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.js CHANGED
@@ -637,7 +637,7 @@
637
637
  // Some browsers don't allow to use bind on console object anyway
638
638
  // fallback to default if needed
639
639
  try {
640
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.9-0.canary.10267");
640
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.9-0.canary.10268");
641
641
  } catch (e) {
642
642
  /* log fn threw an exception. All logger methods are no-ops. */
643
643
  return createLogger();
@@ -10044,11 +10044,14 @@
10044
10044
  var fragmentTracker = this.fragmentTracker;
10045
10045
  var fragState = fragmentTracker.getState(frag);
10046
10046
  if (fragState === FragmentState.APPENDING) {
10047
- // Lower the buffer size and try again
10047
+ // Lower the max buffer length and try again
10048
10048
  var playlistType = frag.type;
10049
10049
  var bufferedInfo = this.getFwdBufferInfo(this.mediaBuffer, playlistType);
10050
10050
  var minForwardBufferLength = Math.max(frag.duration, bufferedInfo ? bufferedInfo.len : this.config.maxBufferLength);
10051
- if (this.reduceMaxBufferLength(minForwardBufferLength)) {
10051
+ // If backtracking, always remove from the tracker without reducing max buffer length
10052
+ var backtrackFragment = this.backtrackFragment;
10053
+ var backtracked = backtrackFragment ? frag.sn - backtrackFragment.sn : 0;
10054
+ if (backtracked === 1 || this.reduceMaxBufferLength(minForwardBufferLength)) {
10052
10055
  fragmentTracker.removeFragment(frag);
10053
10056
  }
10054
10057
  } else if (((_this$mediaBuffer = this.mediaBuffer) == null ? void 0 : _this$mediaBuffer.buffered.length) === 0) {
@@ -10549,10 +10552,11 @@
10549
10552
  _proto.reduceMaxBufferLength = function reduceMaxBufferLength(threshold) {
10550
10553
  var config = this.config;
10551
10554
  var minLength = threshold || config.maxBufferLength;
10552
- if (config.maxMaxBufferLength >= minLength) {
10555
+ var reducedLength = config.maxMaxBufferLength / 2;
10556
+ if (reducedLength >= minLength) {
10553
10557
  // reduce max buffer length as it might be too high. we do this to avoid loop flushing ...
10554
- config.maxMaxBufferLength /= 2;
10555
- this.warn("Reduce max buffer length to " + config.maxMaxBufferLength + "s");
10558
+ config.maxMaxBufferLength = reducedLength;
10559
+ this.warn("Reduce max buffer length to " + reducedLength + "s");
10556
10560
  return true;
10557
10561
  }
10558
10562
  return false;
@@ -30516,7 +30520,7 @@
30516
30520
  * Get the video-dev/hls.js package version.
30517
30521
  */
30518
30522
  function get() {
30519
- return "1.5.9-0.canary.10267";
30523
+ return "1.5.9-0.canary.10268";
30520
30524
  }
30521
30525
  }, {
30522
30526
  key: "Events",