hls.js 1.6.0-beta.2.0.canary.10833 → 1.6.0-beta.2.0.canary.10837

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
@@ -401,7 +401,7 @@ function enableLogs(debugConfig, context, id) {
401
401
  // Some browsers don't allow to use bind on console object anyway
402
402
  // fallback to default if needed
403
403
  try {
404
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.2.0.canary.10833"}`);
404
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.2.0.canary.10837"}`);
405
405
  } catch (e) {
406
406
  /* log fn threw an exception. All logger methods are no-ops. */
407
407
  return createLogger();
@@ -9844,7 +9844,7 @@ var eventemitter3 = {exports: {}};
9844
9844
  var eventemitter3Exports = eventemitter3.exports;
9845
9845
  var EventEmitter = /*@__PURE__*/getDefaultExportFromCjs(eventemitter3Exports);
9846
9846
 
9847
- const version = "1.6.0-beta.2.0.canary.10833";
9847
+ const version = "1.6.0-beta.2.0.canary.10837";
9848
9848
 
9849
9849
  // ensure the worker ends up in the bundle
9850
9850
  // If the worker should not be included this gets aliased to empty.js
@@ -23589,7 +23589,9 @@ class AssetListLoader {
23589
23589
  }
23590
23590
 
23591
23591
  function playWithCatch(media) {
23592
- media == null ? void 0 : media.play().catch() /* no-op */;
23592
+ media == null ? void 0 : media.play().catch(() => {
23593
+ /* no-op */
23594
+ });
23593
23595
  }
23594
23596
  class InterstitialsController extends Logger {
23595
23597
  constructor(hls, HlsPlayerClass) {
@@ -23758,16 +23760,20 @@ Schedule: ${scheduleItems.map(seg => segmentToString(seg))}`);
23758
23760
  });
23759
23761
 
23760
23762
  // Update schedule item references
23761
- // Do not change Interstitial playingItem - used for INTERSTITIAL_ASSET_ENDED and INTERSTITIAL_ENDED
23762
- if (playingItem && !playingItem.event) {
23763
- this.playingItem = this.updateItem(playingItem, this.timelinePos);
23763
+ // Do not replace Interstitial playingItem without a match - used for INTERSTITIAL_ASSET_ENDED and INTERSTITIAL_ENDED
23764
+ if (playingItem) {
23765
+ const updatedPlayingItem = this.updateItem(playingItem, this.timelinePos);
23766
+ if (this.itemsMatch(playingItem, updatedPlayingItem)) {
23767
+ this.playingItem = updatedPlayingItem;
23768
+ }
23764
23769
  }
23765
- // Do not change Interstitial bufferingItem - used for transfering media element or source
23770
+ // Do not replace Interstitial bufferingItem without a match - used for transfering media element or source
23766
23771
  const bufferingItem = this.bufferingItem;
23767
23772
  if (bufferingItem) {
23768
- if (!bufferingItem.event) {
23769
- this.bufferingItem = this.updateItem(bufferingItem, this.bufferedPos);
23770
- } else if (!this.updateItem(bufferingItem)) {
23773
+ const updatedBufferingItem = this.updateItem(bufferingItem, this.bufferedPos);
23774
+ if (this.itemsMatch(bufferingItem, updatedBufferingItem)) {
23775
+ this.bufferingItem = updatedBufferingItem;
23776
+ } else if (bufferingItem.event) {
23771
23777
  // Interstitial removed from schedule (Live -> VOD or other scenario where Start Date is outside the range of VOD Playlist)
23772
23778
  this.bufferingItem = null;
23773
23779
  this.clearInterstitial(bufferingItem.event, null);
@@ -24682,7 +24688,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
24682
24688
  const {
24683
24689
  playingItem
24684
24690
  } = this;
24685
- if (playingItem && playingItem !== this.bufferingItem && !this.isInterstitial(playingItem)) {
24691
+ if (playingItem && !this.itemsMatch(playingItem, this.bufferingItem) && !this.isInterstitial(playingItem)) {
24686
24692
  const timelinePos = this.timelinePos;
24687
24693
  this.bufferedPos = timelinePos;
24688
24694
  this.setBufferingItem(playingItem);
@@ -24787,18 +24793,21 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
24787
24793
  this.preloadAssets(nextItemToBuffer.event, 0);
24788
24794
  }
24789
24795
  }
24790
- } else if (bufferIsEmpty && playingItem && bufferingItem !== playingItem && bufferEndIndex === playingIndex) {
24796
+ } else if (bufferIsEmpty && playingItem && !this.itemsMatch(playingItem, bufferingItem) && bufferEndIndex === playingIndex) {
24791
24797
  this.bufferedToItem(playingItem);
24792
24798
  }
24793
24799
  }
24794
24800
  setBufferingItem(item) {
24795
24801
  const bufferingLast = this.bufferingItem;
24796
24802
  const schedule = this.schedule;
24797
- const {
24798
- items,
24799
- events
24800
- } = schedule;
24801
- if (items && events && (!bufferingLast || schedule.findItemIndex(bufferingLast) !== schedule.findItemIndex(item))) {
24803
+ if (!this.itemsMatch(item, bufferingLast)) {
24804
+ const {
24805
+ items,
24806
+ events
24807
+ } = schedule;
24808
+ if (!items || !events) {
24809
+ return bufferingLast;
24810
+ }
24802
24811
  const isInterstitial = this.isInterstitial(item);
24803
24812
  const bufferingPlayer = this.getBufferingPlayer();
24804
24813
  const timeRemaining = bufferingPlayer ? bufferingPlayer.remaining : bufferingLast ? bufferingLast.end - this.timelinePos : 0;
@@ -24820,6 +24829,8 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`);
24820
24829
  bufferingIndex: this.findItemIndex(item),
24821
24830
  playingIndex: this.findItemIndex(this.playingItem)
24822
24831
  });
24832
+ } else if (this.bufferingItem !== item) {
24833
+ this.bufferingItem = item;
24823
24834
  }
24824
24835
  return bufferingLast;
24825
24836
  }