hls.js 1.6.0-beta.2.0.canary.10833 → 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 +26 -15
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +2 -2
- package/dist/hls.light.min.js +1 -1
- package/dist/hls.light.mjs +2 -2
- package/dist/hls.min.js +1 -1
- package/dist/hls.min.js.map +1 -1
- package/dist/hls.mjs +28 -17
- package/dist/hls.mjs.map +1 -1
- package/dist/hls.worker.js +1 -1
- package/package.json +1 -1
- package/src/controller/interstitials-controller.ts +26 -17
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.
|
404
|
+
newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.6.0-beta.2.0.canary.10835"}`);
|
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.
|
9847
|
+
const version = "1.6.0-beta.2.0.canary.10835";
|
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()
|
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
|
23762
|
-
if (playingItem
|
23763
|
-
|
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
|
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
|
-
|
23769
|
-
|
23770
|
-
|
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
|
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
|
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
|
-
|
24798
|
-
|
24799
|
-
|
24800
|
-
|
24801
|
-
|
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
|
}
|