hls.js 1.6.0-beta.1.0.canary.10812 → 1.6.0-beta.1.0.canary.10813

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
@@ -400,7 +400,7 @@ function enableLogs(debugConfig, context, id) {
400
400
  // Some browsers don't allow to use bind on console object anyway
401
401
  // fallback to default if needed
402
402
  try {
403
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.10812"}`);
403
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.1.0.canary.10813"}`);
404
404
  } catch (e) {
405
405
  /* log fn threw an exception. All logger methods are no-ops. */
406
406
  return createLogger();
@@ -9835,7 +9835,7 @@ var eventemitter3 = {exports: {}};
9835
9835
  var eventemitter3Exports = eventemitter3.exports;
9836
9836
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
9837
9837
 
9838
- const version = "1.6.0-beta.1.0.canary.10812";
9838
+ const version = "1.6.0-beta.1.0.canary.10813";
9839
9839
 
9840
9840
  // ensure the worker ends up in the bundle
9841
9841
  // If the worker should not be included this gets aliased to empty.js
@@ -23716,9 +23716,6 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
23716
23716
  if (removedIds.length) {
23717
23717
  this.log(`Removed events ${removedIds}`);
23718
23718
  }
23719
- if (this.isInterstitial(playingItem) && removedIds.includes(playingItem.event.identifier)) {
23720
- this.warn(`Interstitial "${playingItem.event.identifier}" removed while playing`);
23721
- }
23722
23719
  this.playerQueue.forEach(player => {
23723
23720
  if (player.interstitial.appendInPlace) {
23724
23721
  const timelineStart = player.assetItem.timelineStart;
@@ -23748,14 +23745,14 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
23748
23745
  } else if (!this.updateItem(bufferingItem)) {
23749
23746
  // Interstitial removed from schedule (Live -> VOD or other scenario where Start Date is outside the range of VOD Playlist)
23750
23747
  this.bufferingItem = null;
23751
- this.clearInterstitial(bufferingItem.event);
23748
+ this.clearInterstitial(bufferingItem.event, null);
23752
23749
  }
23753
23750
  }
23754
23751
  // Clear waitingItem if it has been removed from the schedule
23755
23752
  this.waitingItem = this.updateItem(this.waitingItem);
23756
23753
  removedInterstitials.forEach(interstitial => {
23757
23754
  interstitial.assetList.forEach(asset => {
23758
- this.clearAssetPlayer(asset.identifier);
23755
+ this.clearAssetPlayer(asset.identifier, null);
23759
23756
  });
23760
23757
  });
23761
23758
  if (interstitialsUpdated || previousItems) {
@@ -23765,6 +23762,11 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
23765
23762
  durations,
23766
23763
  removedIds
23767
23764
  });
23765
+ if (this.isInterstitial(playingItem) && removedIds.includes(playingItem.event.identifier)) {
23766
+ this.warn(`Interstitial "${playingItem.event.identifier}" removed while playing`);
23767
+ this.primaryFallback(playingItem.event);
23768
+ return;
23769
+ }
23768
23770
 
23769
23771
  // Check is buffered to new Interstitial event boundary
23770
23772
  // (Live update publishes Interstitial with new segment)
@@ -24498,9 +24500,6 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
24498
24500
  this.playingAsset = null;
24499
24501
  this.waitingItem = null;
24500
24502
  this.bufferedToItem(scheduledItem);
24501
- if (!fromItem) {
24502
- return;
24503
- }
24504
24503
  this.log(`resuming ${segmentToString(scheduledItem)}`);
24505
24504
  if (!((_this$detachedData3 = this.detachedData) != null && _this$detachedData3.mediaSource)) {
24506
24505
  let timelinePos = this.timelinePos;
@@ -24510,6 +24509,9 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
24510
24509
  }
24511
24510
  this.attachPrimary(timelinePos, scheduledItem);
24512
24511
  }
24512
+ if (!fromItem) {
24513
+ return;
24514
+ }
24513
24515
  const scheduleItems = this.schedule.items;
24514
24516
  if (!scheduleItems) {
24515
24517
  return;
@@ -25220,7 +25222,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
25220
25222
  const error = new Error(errorMessage);
25221
25223
  if (assetItem) {
25222
25224
  if (this.playingAsset !== assetItem) {
25223
- this.clearAssetPlayer(assetItem.identifier);
25225
+ this.clearAssetPlayer(assetItem.identifier, null);
25224
25226
  }
25225
25227
  assetItem.error = error;
25226
25228
  }
@@ -25241,6 +25243,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
25241
25243
  // Update schedule now that interstitial/assets are flagged with `error` for fallback
25242
25244
  this.updateSchedule();
25243
25245
  if (playingItem) {
25246
+ this.log(`Fallback to primary from event "${interstitial.identifier}" start: ${flushStart} pos: ${this.timelinePos} playing: ${playingItem ? segmentToString(playingItem) : '<none>'} error: ${interstitial.error}`);
25244
25247
  if (interstitial.appendInPlace) {
25245
25248
  interstitial.appendInPlace = false;
25246
25249
  this.attachPrimary(flushStart, null);
@@ -32672,6 +32675,7 @@ class PlaylistLoader {
32672
32675
  this.hls = void 0;
32673
32676
  this.loaders = Object.create(null);
32674
32677
  this.variableList = null;
32678
+ this.onManifestLoaded = this.checkAutostartLoad;
32675
32679
  this.hls = hls;
32676
32680
  this.registerListeners();
32677
32681
  }
@@ -32998,11 +33002,6 @@ class PlaylistLoader {
32998
33002
  variableList
32999
33003
  });
33000
33004
  }
33001
- onManifestLoaded(event, data) {
33002
- if (!data.isMediaPlaylist) {
33003
- this.checkAutostartLoad();
33004
- }
33005
- }
33006
33005
  handleTrackOrLevelPlaylist(response, stats, context, networkDetails, loader) {
33007
33006
  const hls = this.hls;
33008
33007
  const {
@@ -33027,6 +33026,7 @@ class PlaylistLoader {
33027
33026
  name: '',
33028
33027
  url
33029
33028
  };
33029
+ levelDetails.requestScheduled = stats.loading.start + computeReloadInterval(levelDetails, 0);
33030
33030
  hls.trigger(Events.MANIFEST_LOADED, {
33031
33031
  levels: [singleLevel],
33032
33032
  audioTracks: [],
@@ -33037,8 +33037,7 @@ class PlaylistLoader {
33037
33037
  sessionKeys: null,
33038
33038
  contentSteering: null,
33039
33039
  startTimeOffset: null,
33040
- variableList: null,
33041
- isMediaPlaylist: true
33040
+ variableList: null
33042
33041
  });
33043
33042
  }
33044
33043
 
@@ -33048,9 +33047,6 @@ class PlaylistLoader {
33048
33047
  // extend the context with the new levelDetails property
33049
33048
  context.levelDetails = levelDetails;
33050
33049
  this.handlePlaylistLoaded(levelDetails, response, stats, context, networkDetails, loader);
33051
- if (type === PlaylistContextType.MANIFEST && (!levelDetails.playlistParsingError || !levelDetails.fragments.length && levelDetails.live)) {
33052
- this.checkAutostartLoad();
33053
- }
33054
33050
  }
33055
33051
  handleManifestParsingError(response, context, error, networkDetails, stats) {
33056
33052
  this.hls.trigger(Events.ERROR, {