hls.js 1.4.6 → 1.4.8

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
@@ -508,7 +508,7 @@
508
508
  // Some browsers don't allow to use bind on console object anyway
509
509
  // fallback to default if needed
510
510
  try {
511
- exportedLogger.log("Debug logs enabled for \"" + id + "\" in hls.js version " + "1.4.6");
511
+ exportedLogger.log("Debug logs enabled for \"" + id + "\" in hls.js version " + "1.4.8");
512
512
  } catch (e) {
513
513
  exportedLogger = fakeLogger;
514
514
  }
@@ -9095,10 +9095,8 @@
9095
9095
  retryCount = _ref2$retryCount === void 0 ? 0 : _ref2$retryCount,
9096
9096
  retryConfig = _ref2.retryConfig;
9097
9097
  if (errorAction && action === NetworkErrorAction.RetryRequest && retryConfig) {
9098
- if (!this.loadedmetadata) {
9099
- this.startFragRequested = false;
9100
- this.nextLoadPosition = this.startPosition;
9101
- }
9098
+ var _this$levelLastLoaded;
9099
+ this.resetStartWhenNotLoaded((_this$levelLastLoaded = this.levelLastLoaded) != null ? _this$levelLastLoaded : frag.level);
9102
9100
  var delay = getRetryDelay(retryConfig, retryCount);
9103
9101
  this.warn("Fragment " + frag.sn + " of " + filterType + " " + frag.level + " errored with " + data.details + ", retrying loading " + (retryCount + 1) + "/" + retryConfig.maxNumRetry + " in " + delay + "ms");
9104
9102
  errorAction.resolved = true;
@@ -9114,6 +9112,8 @@
9114
9112
  } else {
9115
9113
  logger.warn(data.details + " reached or exceeded max retry (" + retryCount + ")");
9116
9114
  }
9115
+ } else if ((errorAction == null ? void 0 : errorAction.action) === NetworkErrorAction.SendAlternateToPenaltyBox) {
9116
+ this.state = State.WAITING_LEVEL;
9117
9117
  } else {
9118
9118
  this.state = State.ERROR;
9119
9119
  }
@@ -9196,9 +9196,10 @@
9196
9196
  }
9197
9197
  };
9198
9198
  _proto.resetWhenMissingContext = function resetWhenMissingContext(chunkMeta) {
9199
+ var _this$levelLastLoaded2;
9199
9200
  this.warn("The loading context changed while buffering fragment " + chunkMeta.sn + " of level " + chunkMeta.level + ". This chunk will not be buffered.");
9200
9201
  this.removeUnbufferedFrags();
9201
- this.resetStartWhenNotLoaded(chunkMeta.level);
9202
+ this.resetStartWhenNotLoaded((_this$levelLastLoaded2 = this.levelLastLoaded) != null ? _this$levelLastLoaded2 : chunkMeta.level);
9202
9203
  this.resetLoadingState();
9203
9204
  };
9204
9205
  _proto.removeUnbufferedFrags = function removeUnbufferedFrags(start) {
@@ -9274,7 +9275,10 @@
9274
9275
  };
9275
9276
  _proto.recoverWorkerError = function recoverWorkerError(data) {
9276
9277
  if (data.event === 'demuxerWorker') {
9278
+ var _ref3, _this$levelLastLoaded3, _this$fragCurrent3;
9279
+ this.fragmentTracker.removeAllFragments();
9277
9280
  this.resetTransmuxer();
9281
+ this.resetStartWhenNotLoaded((_ref3 = (_this$levelLastLoaded3 = this.levelLastLoaded) != null ? _this$levelLastLoaded3 : (_this$fragCurrent3 = this.fragCurrent) == null ? void 0 : _this$fragCurrent3.level) != null ? _ref3 : 0);
9278
9282
  this.resetLoadingState();
9279
9283
  }
9280
9284
  };
@@ -15595,6 +15599,7 @@
15595
15599
  }
15596
15600
 
15597
15601
  // Avoid buffering if backtracking this fragment
15602
+ var notFirstFragment = frag.sn !== (details == null ? void 0 : details.startSN);
15598
15603
  if (video && remuxResult.independent !== false) {
15599
15604
  if (details) {
15600
15605
  var startPTS = video.startPTS,
@@ -15618,7 +15623,7 @@
15618
15623
  var bufferInfo = this.getMainFwdBufferInfo();
15619
15624
  var targetBufferTime = (bufferInfo ? bufferInfo.end : this.getLoadPosition()) + this.config.maxBufferHole;
15620
15625
  var startTime = video.firstKeyFramePTS ? video.firstKeyFramePTS : startPTS;
15621
- if (targetBufferTime < startTime - this.config.maxBufferHole) {
15626
+ if (notFirstFragment && targetBufferTime < startTime - this.config.maxBufferHole) {
15622
15627
  this.backtrack(frag);
15623
15628
  return;
15624
15629
  }
@@ -15632,7 +15637,7 @@
15632
15637
  }
15633
15638
  this.bufferFragmentData(video, frag, part, chunkMeta);
15634
15639
  }
15635
- } else if (remuxResult.independent === false) {
15640
+ } else if (notFirstFragment && remuxResult.independent === false) {
15636
15641
  this.backtrack(frag);
15637
15642
  return;
15638
15643
  }
@@ -17644,6 +17649,7 @@
17644
17649
  var stats = this.stats;
17645
17650
  stats.loading.first = 0;
17646
17651
  stats.loaded = 0;
17652
+ stats.aborted = false;
17647
17653
  var xhrSetup = this.xhrSetup;
17648
17654
  if (xhrSetup) {
17649
17655
  Promise.resolve().then(function () {
@@ -19228,7 +19234,7 @@
19228
19234
  * Get the video-dev/hls.js package version.
19229
19235
  */
19230
19236
  function get() {
19231
- return "1.4.6";
19237
+ return "1.4.8";
19232
19238
  }
19233
19239
  }, {
19234
19240
  key: "Events",