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.js CHANGED
@@ -539,7 +539,7 @@
539
539
  // Some browsers don't allow to use bind on console object anyway
540
540
  // fallback to default if needed
541
541
  try {
542
- exportedLogger.log("Debug logs enabled for \"" + id + "\" in hls.js version " + "1.4.7");
542
+ exportedLogger.log("Debug logs enabled for \"" + id + "\" in hls.js version " + "1.4.8");
543
543
  } catch (e) {
544
544
  exportedLogger = fakeLogger;
545
545
  }
@@ -9642,10 +9642,8 @@
9642
9642
  retryCount = _ref2$retryCount === void 0 ? 0 : _ref2$retryCount,
9643
9643
  retryConfig = _ref2.retryConfig;
9644
9644
  if (errorAction && action === NetworkErrorAction.RetryRequest && retryConfig) {
9645
- if (!this.loadedmetadata) {
9646
- this.startFragRequested = false;
9647
- this.nextLoadPosition = this.startPosition;
9648
- }
9645
+ var _this$levelLastLoaded;
9646
+ this.resetStartWhenNotLoaded((_this$levelLastLoaded = this.levelLastLoaded) != null ? _this$levelLastLoaded : frag.level);
9649
9647
  var delay = getRetryDelay(retryConfig, retryCount);
9650
9648
  this.warn("Fragment " + frag.sn + " of " + filterType + " " + frag.level + " errored with " + data.details + ", retrying loading " + (retryCount + 1) + "/" + retryConfig.maxNumRetry + " in " + delay + "ms");
9651
9649
  errorAction.resolved = true;
@@ -9745,9 +9743,10 @@
9745
9743
  }
9746
9744
  };
9747
9745
  _proto.resetWhenMissingContext = function resetWhenMissingContext(chunkMeta) {
9746
+ var _this$levelLastLoaded2;
9748
9747
  this.warn("The loading context changed while buffering fragment " + chunkMeta.sn + " of level " + chunkMeta.level + ". This chunk will not be buffered.");
9749
9748
  this.removeUnbufferedFrags();
9750
- this.resetStartWhenNotLoaded(chunkMeta.level);
9749
+ this.resetStartWhenNotLoaded((_this$levelLastLoaded2 = this.levelLastLoaded) != null ? _this$levelLastLoaded2 : chunkMeta.level);
9751
9750
  this.resetLoadingState();
9752
9751
  };
9753
9752
  _proto.removeUnbufferedFrags = function removeUnbufferedFrags(start) {
@@ -9823,7 +9822,10 @@
9823
9822
  };
9824
9823
  _proto.recoverWorkerError = function recoverWorkerError(data) {
9825
9824
  if (data.event === 'demuxerWorker') {
9825
+ var _ref3, _this$levelLastLoaded3, _this$fragCurrent3;
9826
+ this.fragmentTracker.removeAllFragments();
9826
9827
  this.resetTransmuxer();
9828
+ this.resetStartWhenNotLoaded((_ref3 = (_this$levelLastLoaded3 = this.levelLastLoaded) != null ? _this$levelLastLoaded3 : (_this$fragCurrent3 = this.fragCurrent) == null ? void 0 : _this$fragCurrent3.level) != null ? _ref3 : 0);
9827
9829
  this.resetLoadingState();
9828
9830
  }
9829
9831
  };
@@ -16159,6 +16161,7 @@
16159
16161
  }
16160
16162
 
16161
16163
  // Avoid buffering if backtracking this fragment
16164
+ var notFirstFragment = frag.sn !== (details == null ? void 0 : details.startSN);
16162
16165
  if (video && remuxResult.independent !== false) {
16163
16166
  if (details) {
16164
16167
  var startPTS = video.startPTS,
@@ -16182,7 +16185,7 @@
16182
16185
  var bufferInfo = this.getMainFwdBufferInfo();
16183
16186
  var targetBufferTime = (bufferInfo ? bufferInfo.end : this.getLoadPosition()) + this.config.maxBufferHole;
16184
16187
  var startTime = video.firstKeyFramePTS ? video.firstKeyFramePTS : startPTS;
16185
- if (targetBufferTime < startTime - this.config.maxBufferHole) {
16188
+ if (notFirstFragment && targetBufferTime < startTime - this.config.maxBufferHole) {
16186
16189
  this.backtrack(frag);
16187
16190
  return;
16188
16191
  }
@@ -16196,7 +16199,7 @@
16196
16199
  }
16197
16200
  this.bufferFragmentData(video, frag, part, chunkMeta);
16198
16201
  }
16199
- } else if (remuxResult.independent === false) {
16202
+ } else if (notFirstFragment && remuxResult.independent === false) {
16200
16203
  this.backtrack(frag);
16201
16204
  return;
16202
16205
  }
@@ -26260,7 +26263,7 @@
26260
26263
  * Get the video-dev/hls.js package version.
26261
26264
  */
26262
26265
  function get() {
26263
- return "1.4.7";
26266
+ return "1.4.8";
26264
26267
  }
26265
26268
  }, {
26266
26269
  key: "Events",