hls.js 1.6.0-beta.2.0.canary.10831 → 1.6.0-beta.2.0.canary.10835

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
@@ -1058,7 +1058,7 @@
1058
1058
  // Some browsers don't allow to use bind on console object anyway
1059
1059
  // fallback to default if needed
1060
1060
  try {
1061
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.2.0.canary.10831");
1061
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.2.0.canary.10835");
1062
1062
  } catch (e) {
1063
1063
  /* log fn threw an exception. All logger methods are no-ops. */
1064
1064
  return createLogger();
@@ -16305,7 +16305,7 @@
16305
16305
  return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
16306
16306
  }
16307
16307
 
16308
- var version = "1.6.0-beta.2.0.canary.10831";
16308
+ var version = "1.6.0-beta.2.0.canary.10835";
16309
16309
 
16310
16310
  // ensure the worker ends up in the bundle
16311
16311
  // If the worker should not be included this gets aliased to empty.js
@@ -23798,7 +23798,9 @@
23798
23798
  }();
23799
23799
 
23800
23800
  function playWithCatch(media) {
23801
- media == null ? void 0 : media.play().catch() /* no-op */;
23801
+ media == null ? void 0 : media.play().catch(function () {
23802
+ /* no-op */
23803
+ });
23802
23804
  }
23803
23805
  var InterstitialsController = /*#__PURE__*/function (_Logger) {
23804
23806
  function InterstitialsController(hls, HlsPlayerClass) {
@@ -23973,16 +23975,20 @@
23973
23975
  });
23974
23976
 
23975
23977
  // Update schedule item references
23976
- // Do not change Interstitial playingItem - used for INTERSTITIAL_ASSET_ENDED and INTERSTITIAL_ENDED
23977
- if (playingItem && !playingItem.event) {
23978
- _this.playingItem = _this.updateItem(playingItem, _this.timelinePos);
23978
+ // Do not replace Interstitial playingItem without a match - used for INTERSTITIAL_ASSET_ENDED and INTERSTITIAL_ENDED
23979
+ if (playingItem) {
23980
+ var updatedPlayingItem = _this.updateItem(playingItem, _this.timelinePos);
23981
+ if (_this.itemsMatch(playingItem, updatedPlayingItem)) {
23982
+ _this.playingItem = updatedPlayingItem;
23983
+ }
23979
23984
  }
23980
- // Do not change Interstitial bufferingItem - used for transfering media element or source
23985
+ // Do not replace Interstitial bufferingItem without a match - used for transfering media element or source
23981
23986
  var bufferingItem = _this.bufferingItem;
23982
23987
  if (bufferingItem) {
23983
- if (!bufferingItem.event) {
23984
- _this.bufferingItem = _this.updateItem(bufferingItem, _this.bufferedPos);
23985
- } else if (!_this.updateItem(bufferingItem)) {
23988
+ var updatedBufferingItem = _this.updateItem(bufferingItem, _this.bufferedPos);
23989
+ if (_this.itemsMatch(bufferingItem, updatedBufferingItem)) {
23990
+ _this.bufferingItem = updatedBufferingItem;
23991
+ } else if (bufferingItem.event) {
23986
23992
  // Interstitial removed from schedule (Live -> VOD or other scenario where Start Date is outside the range of VOD Playlist)
23987
23993
  _this.bufferingItem = null;
23988
23994
  _this.clearInterstitial(bufferingItem.event, null);
@@ -24623,7 +24629,7 @@
24623
24629
  };
24624
24630
  _proto.onBufferFlushed = function onBufferFlushed(event, data) {
24625
24631
  var playingItem = this.playingItem;
24626
- if (playingItem && playingItem !== this.bufferingItem && !this.isInterstitial(playingItem)) {
24632
+ if (playingItem && !this.itemsMatch(playingItem, this.bufferingItem) && !this.isInterstitial(playingItem)) {
24627
24633
  var timelinePos = this.timelinePos;
24628
24634
  this.bufferedPos = timelinePos;
24629
24635
  this.setBufferingItem(playingItem);
@@ -24729,16 +24735,19 @@
24729
24735
  this.preloadAssets(nextItemToBuffer.event, 0);
24730
24736
  }
24731
24737
  }
24732
- } else if (bufferIsEmpty && playingItem && bufferingItem !== playingItem && bufferEndIndex === playingIndex) {
24738
+ } else if (bufferIsEmpty && playingItem && !this.itemsMatch(playingItem, bufferingItem) && bufferEndIndex === playingIndex) {
24733
24739
  this.bufferedToItem(playingItem);
24734
24740
  }
24735
24741
  };
24736
24742
  _proto.setBufferingItem = function setBufferingItem(item) {
24737
24743
  var bufferingLast = this.bufferingItem;
24738
24744
  var schedule = this.schedule;
24739
- var items = schedule.items,
24740
- events = schedule.events;
24741
- if (items && events && (!bufferingLast || schedule.findItemIndex(bufferingLast) !== schedule.findItemIndex(item))) {
24745
+ if (!this.itemsMatch(item, bufferingLast)) {
24746
+ var items = schedule.items,
24747
+ events = schedule.events;
24748
+ if (!items || !events) {
24749
+ return bufferingLast;
24750
+ }
24742
24751
  var isInterstitial = this.isInterstitial(item);
24743
24752
  var bufferingPlayer = this.getBufferingPlayer();
24744
24753
  var timeRemaining = bufferingPlayer ? bufferingPlayer.remaining : bufferingLast ? bufferingLast.end - this.timelinePos : 0;
@@ -24764,6 +24773,8 @@
24764
24773
  bufferingIndex: this.findItemIndex(item),
24765
24774
  playingIndex: this.findItemIndex(this.playingItem)
24766
24775
  });
24776
+ } else if (this.bufferingItem !== item) {
24777
+ this.bufferingItem = item;
24767
24778
  }
24768
24779
  return bufferingLast;
24769
24780
  };