hls.js 1.6.0-beta.3.0.canary.10960 → 1.6.0-beta.3.0.canary.10963

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.mjs CHANGED
@@ -402,7 +402,7 @@ function enableLogs(debugConfig, context, id) {
402
402
  // Some browsers don't allow to use bind on console object anyway
403
403
  // fallback to default if needed
404
404
  try {
405
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.3.0.canary.10960"}`);
405
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.3.0.canary.10963"}`);
406
406
  } catch (e) {
407
407
  /* log fn threw an exception. All logger methods are no-ops. */
408
408
  return createLogger();
@@ -9887,7 +9887,7 @@ var eventemitter3 = {exports: {}};
9887
9887
  var eventemitter3Exports = eventemitter3.exports;
9888
9888
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
9889
9889
 
9890
- const version = "1.6.0-beta.3.0.canary.10960";
9890
+ const version = "1.6.0-beta.3.0.canary.10963";
9891
9891
 
9892
9892
  // ensure the worker ends up in the bundle
9893
9893
  // If the worker should not be included this gets aliased to empty.js
@@ -22852,7 +22852,7 @@ class InterstitialEvent {
22852
22852
  get duration() {
22853
22853
  const playoutLimit = this.playoutLimit;
22854
22854
  let duration;
22855
- if (this._duration) {
22855
+ if (this._duration !== null) {
22856
22856
  duration = this._duration;
22857
22857
  } else if (this.dateRange.duration) {
22858
22858
  duration = this.dateRange.duration;
@@ -22891,6 +22891,9 @@ class InterstitialEvent {
22891
22891
  get baseUrl() {
22892
22892
  return this.base.url;
22893
22893
  }
22894
+ get assetListLoaded() {
22895
+ return this.assetList.length > 0 || this.assetListResponse !== null;
22896
+ }
22894
22897
  toString() {
22895
22898
  return eventToString(this);
22896
22899
  }
@@ -23543,6 +23546,9 @@ class InterstitialsSchedule extends Logger {
23543
23546
  });
23544
23547
  }
23545
23548
  updateAssetDurations(interstitial) {
23549
+ if (!interstitial.assetListLoaded) {
23550
+ return;
23551
+ }
23546
23552
  const eventStart = interstitial.timelineStart;
23547
23553
  let sumDuration = 0;
23548
23554
  let hasUnknownDuration = false;
@@ -24541,8 +24547,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
24541
24547
  scheduleIndex: index
24542
24548
  });
24543
24549
  }
24544
- const assetListLength = interstitial.assetList.length;
24545
- if (assetListLength === 0 && !interstitial.assetListResponse) {
24550
+ if (!interstitial.assetListLoaded) {
24546
24551
  // Waiting at end of primary content segment
24547
24552
  // Expect setSchedulePosition to be called again once ASSET-LIST is loaded
24548
24553
  this.log(`Waiting for ASSET-LIST to complete loading ${interstitial}`);
@@ -24577,6 +24582,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
24577
24582
  player = this.getAssetPlayer(assetItem.identifier);
24578
24583
  }
24579
24584
  if (player === null || player.destroyed) {
24585
+ const assetListLength = interstitial.assetList.length;
24580
24586
  this.warn(`asset ${assetListIndex + 1}/${assetListLength} player destroyed ${interstitial}`);
24581
24587
  player = this.createAssetPlayer(interstitial, assetItem, assetListIndex);
24582
24588
  }
@@ -24691,8 +24697,11 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
24691
24697
  }
24692
24698
  }
24693
24699
  startLoadingPrimaryAt(timelinePos, skipSeekToStartPosition) {
24694
- if (this.hls.loadingEnabled) {
24695
- this.hls.startLoad(timelinePos, skipSeekToStartPosition);
24700
+ const hls = this.hls;
24701
+ if (!hls.loadingEnabled || !hls.media || Math.abs(hls.media.currentTime - timelinePos) > 0.5) {
24702
+ hls.startLoad(timelinePos, skipSeekToStartPosition);
24703
+ } else if (!hls.bufferingEnabled) {
24704
+ hls.resumeBuffering();
24696
24705
  }
24697
24706
  }
24698
24707
 
@@ -24986,6 +24995,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
24986
24995
  liveStartPosition = this.hls.liveSyncPosition || 0;
24987
24996
  }
24988
24997
  }
24998
+ interstitial.assetListResponse = null;
24989
24999
  const assetListLoader = this.assetListLoader.loadAssetList(interstitial, liveStartPosition);
24990
25000
  if (assetListLoader) {
24991
25001
  interstitial.assetListLoader = assetListLoader;