hls.js 1.6.0-beta.1.0.canary.10811 → 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.js +18 -15
- package/dist/hls.js.map +1 -1
- package/dist/hls.light.js +6 -6
- package/dist/hls.light.js.map +1 -1
- package/dist/hls.light.min.js +1 -1
- package/dist/hls.light.min.js.map +1 -1
- package/dist/hls.light.mjs +6 -6
- package/dist/hls.light.mjs.map +1 -1
- package/dist/hls.min.js +1 -1
- package/dist/hls.min.js.map +1 -1
- package/dist/hls.mjs +18 -15
- 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 +27 -16
- package/src/hls.ts +6 -0
- package/src/loader/playlist-loader.ts +4 -10
- package/src/types/events.ts +2 -2
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.
|
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.
|
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
|
}
|
@@ -32997,7 +33001,6 @@ class PlaylistLoader {
|
|
32997
33001
|
startTimeOffset,
|
32998
33002
|
variableList
|
32999
33003
|
});
|
33000
|
-
this.checkAutostartLoad();
|
33001
33004
|
}
|
33002
33005
|
handleTrackOrLevelPlaylist(response, stats, context, networkDetails, loader) {
|
33003
33006
|
const hls = this.hls;
|
@@ -33023,6 +33026,7 @@ class PlaylistLoader {
|
|
33023
33026
|
name: '',
|
33024
33027
|
url
|
33025
33028
|
};
|
33029
|
+
levelDetails.requestScheduled = stats.loading.start + computeReloadInterval(levelDetails, 0);
|
33026
33030
|
hls.trigger(Events.MANIFEST_LOADED, {
|
33027
33031
|
levels: [singleLevel],
|
33028
33032
|
audioTracks: [],
|
@@ -33043,9 +33047,6 @@ class PlaylistLoader {
|
|
33043
33047
|
// extend the context with the new levelDetails property
|
33044
33048
|
context.levelDetails = levelDetails;
|
33045
33049
|
this.handlePlaylistLoaded(levelDetails, response, stats, context, networkDetails, loader);
|
33046
|
-
if (type === PlaylistContextType.MANIFEST && (!levelDetails.playlistParsingError || !levelDetails.fragments.length && levelDetails.live)) {
|
33047
|
-
this.checkAutostartLoad();
|
33048
|
-
}
|
33049
33050
|
}
|
33050
33051
|
handleManifestParsingError(response, context, error, networkDetails, stats) {
|
33051
33052
|
this.hls.trigger(Events.ERROR, {
|
@@ -33384,6 +33385,8 @@ class Hls {
|
|
33384
33385
|
if (typeof onErrorOut === 'function') {
|
33385
33386
|
this.on(Events.ERROR, onErrorOut, errorController);
|
33386
33387
|
}
|
33388
|
+
// Autostart load handler
|
33389
|
+
this.on(Events.MANIFEST_LOADED, playListLoader.onManifestLoaded, playListLoader);
|
33387
33390
|
}
|
33388
33391
|
createController(ControllerClass, components) {
|
33389
33392
|
if (ControllerClass) {
|