hls.js 1.4.7 → 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.7");
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;
@@ -9198,9 +9196,10 @@
9198
9196
  }
9199
9197
  };
9200
9198
  _proto.resetWhenMissingContext = function resetWhenMissingContext(chunkMeta) {
9199
+ var _this$levelLastLoaded2;
9201
9200
  this.warn("The loading context changed while buffering fragment " + chunkMeta.sn + " of level " + chunkMeta.level + ". This chunk will not be buffered.");
9202
9201
  this.removeUnbufferedFrags();
9203
- this.resetStartWhenNotLoaded(chunkMeta.level);
9202
+ this.resetStartWhenNotLoaded((_this$levelLastLoaded2 = this.levelLastLoaded) != null ? _this$levelLastLoaded2 : chunkMeta.level);
9204
9203
  this.resetLoadingState();
9205
9204
  };
9206
9205
  _proto.removeUnbufferedFrags = function removeUnbufferedFrags(start) {
@@ -9276,7 +9275,10 @@
9276
9275
  };
9277
9276
  _proto.recoverWorkerError = function recoverWorkerError(data) {
9278
9277
  if (data.event === 'demuxerWorker') {
9278
+ var _ref3, _this$levelLastLoaded3, _this$fragCurrent3;
9279
+ this.fragmentTracker.removeAllFragments();
9279
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);
9280
9282
  this.resetLoadingState();
9281
9283
  }
9282
9284
  };
@@ -15597,6 +15599,7 @@
15597
15599
  }
15598
15600
 
15599
15601
  // Avoid buffering if backtracking this fragment
15602
+ var notFirstFragment = frag.sn !== (details == null ? void 0 : details.startSN);
15600
15603
  if (video && remuxResult.independent !== false) {
15601
15604
  if (details) {
15602
15605
  var startPTS = video.startPTS,
@@ -15620,7 +15623,7 @@
15620
15623
  var bufferInfo = this.getMainFwdBufferInfo();
15621
15624
  var targetBufferTime = (bufferInfo ? bufferInfo.end : this.getLoadPosition()) + this.config.maxBufferHole;
15622
15625
  var startTime = video.firstKeyFramePTS ? video.firstKeyFramePTS : startPTS;
15623
- if (targetBufferTime < startTime - this.config.maxBufferHole) {
15626
+ if (notFirstFragment && targetBufferTime < startTime - this.config.maxBufferHole) {
15624
15627
  this.backtrack(frag);
15625
15628
  return;
15626
15629
  }
@@ -15634,7 +15637,7 @@
15634
15637
  }
15635
15638
  this.bufferFragmentData(video, frag, part, chunkMeta);
15636
15639
  }
15637
- } else if (remuxResult.independent === false) {
15640
+ } else if (notFirstFragment && remuxResult.independent === false) {
15638
15641
  this.backtrack(frag);
15639
15642
  return;
15640
15643
  }
@@ -19231,7 +19234,7 @@
19231
19234
  * Get the video-dev/hls.js package version.
19232
19235
  */
19233
19236
  function get() {
19234
- return "1.4.7";
19237
+ return "1.4.8";
19235
19238
  }
19236
19239
  }, {
19237
19240
  key: "Events",