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 CHANGED
@@ -1057,7 +1057,7 @@
1057
1057
  // Some browsers don't allow to use bind on console object anyway
1058
1058
  // fallback to default if needed
1059
1059
  try {
1060
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.1.0.canary.10811");
1060
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.6.0-beta.1.0.canary.10813");
1061
1061
  } catch (e) {
1062
1062
  /* log fn threw an exception. All logger methods are no-ops. */
1063
1063
  return createLogger();
@@ -16296,7 +16296,7 @@
16296
16296
  return !remuxResult.audio && !remuxResult.video && !remuxResult.text && !remuxResult.id3 && !remuxResult.initSegment;
16297
16297
  }
16298
16298
 
16299
- var version = "1.6.0-beta.1.0.canary.10811";
16299
+ var version = "1.6.0-beta.1.0.canary.10813";
16300
16300
 
16301
16301
  // ensure the worker ends up in the bundle
16302
16302
  // If the worker should not be included this gets aliased to empty.js
@@ -23928,9 +23928,6 @@
23928
23928
  if (removedIds.length) {
23929
23929
  _this.log("Removed events " + removedIds);
23930
23930
  }
23931
- if (_this.isInterstitial(playingItem) && removedIds.includes(playingItem.event.identifier)) {
23932
- _this.warn("Interstitial \"" + playingItem.event.identifier + "\" removed while playing");
23933
- }
23934
23931
  _this.playerQueue.forEach(function (player) {
23935
23932
  if (player.interstitial.appendInPlace) {
23936
23933
  var timelineStart = player.assetItem.timelineStart;
@@ -23960,14 +23957,14 @@
23960
23957
  } else if (!_this.updateItem(bufferingItem)) {
23961
23958
  // Interstitial removed from schedule (Live -> VOD or other scenario where Start Date is outside the range of VOD Playlist)
23962
23959
  _this.bufferingItem = null;
23963
- _this.clearInterstitial(bufferingItem.event);
23960
+ _this.clearInterstitial(bufferingItem.event, null);
23964
23961
  }
23965
23962
  }
23966
23963
  // Clear waitingItem if it has been removed from the schedule
23967
23964
  _this.waitingItem = _this.updateItem(_this.waitingItem);
23968
23965
  removedInterstitials.forEach(function (interstitial) {
23969
23966
  interstitial.assetList.forEach(function (asset) {
23970
- _this.clearAssetPlayer(asset.identifier);
23967
+ _this.clearAssetPlayer(asset.identifier, null);
23971
23968
  });
23972
23969
  });
23973
23970
  if (interstitialsUpdated || previousItems) {
@@ -23977,6 +23974,11 @@
23977
23974
  durations: durations,
23978
23975
  removedIds: removedIds
23979
23976
  });
23977
+ if (_this.isInterstitial(playingItem) && removedIds.includes(playingItem.event.identifier)) {
23978
+ _this.warn("Interstitial \"" + playingItem.event.identifier + "\" removed while playing");
23979
+ _this.primaryFallback(playingItem.event);
23980
+ return;
23981
+ }
23980
23982
 
23981
23983
  // Check is buffered to new Interstitial event boundary
23982
23984
  // (Live update publishes Interstitial with new segment)
@@ -24433,9 +24435,6 @@
24433
24435
  this.playingAsset = null;
24434
24436
  this.waitingItem = null;
24435
24437
  this.bufferedToItem(scheduledItem);
24436
- if (!fromItem) {
24437
- return;
24438
- }
24439
24438
  this.log("resuming " + segmentToString(scheduledItem));
24440
24439
  if (!((_this$detachedData2 = this.detachedData) != null && _this$detachedData2.mediaSource)) {
24441
24440
  var timelinePos = this.timelinePos;
@@ -24445,6 +24444,9 @@
24445
24444
  }
24446
24445
  this.attachPrimary(timelinePos, scheduledItem);
24447
24446
  }
24447
+ if (!fromItem) {
24448
+ return;
24449
+ }
24448
24450
  var scheduleItems = this.schedule.items;
24449
24451
  if (!scheduleItems) {
24450
24452
  return;
@@ -25164,7 +25166,7 @@
25164
25166
  var error = new Error(errorMessage);
25165
25167
  if (assetItem) {
25166
25168
  if (this.playingAsset !== assetItem) {
25167
- this.clearAssetPlayer(assetItem.identifier);
25169
+ this.clearAssetPlayer(assetItem.identifier, null);
25168
25170
  }
25169
25171
  assetItem.error = error;
25170
25172
  }
@@ -25187,6 +25189,7 @@
25187
25189
  // Update schedule now that interstitial/assets are flagged with `error` for fallback
25188
25190
  this.updateSchedule();
25189
25191
  if (playingItem) {
25192
+ this.log("Fallback to primary from event \"" + interstitial.identifier + "\" start: " + flushStart + " pos: " + this.timelinePos + " playing: " + (playingItem ? segmentToString(playingItem) : '<none>') + " error: " + interstitial.error);
25190
25193
  if (interstitial.appendInPlace) {
25191
25194
  interstitial.appendInPlace = false;
25192
25195
  this.attachPrimary(flushStart, null);
@@ -33566,6 +33569,7 @@
33566
33569
  this.hls = void 0;
33567
33570
  this.loaders = Object.create(null);
33568
33571
  this.variableList = null;
33572
+ this.onManifestLoaded = this.checkAutostartLoad;
33569
33573
  this.hls = hls;
33570
33574
  this.registerListeners();
33571
33575
  }
@@ -33881,7 +33885,6 @@
33881
33885
  startTimeOffset: startTimeOffset,
33882
33886
  variableList: variableList
33883
33887
  });
33884
- this.checkAutostartLoad();
33885
33888
  };
33886
33889
  _proto.handleTrackOrLevelPlaylist = function handleTrackOrLevelPlaylist(response, stats, context, networkDetails, loader) {
33887
33890
  var hls = this.hls;
@@ -33905,6 +33908,7 @@
33905
33908
  name: '',
33906
33909
  url: url
33907
33910
  };
33911
+ levelDetails.requestScheduled = stats.loading.start + computeReloadInterval(levelDetails, 0);
33908
33912
  hls.trigger(Events.MANIFEST_LOADED, {
33909
33913
  levels: [singleLevel],
33910
33914
  audioTracks: [],
@@ -33925,9 +33929,6 @@
33925
33929
  // extend the context with the new levelDetails property
33926
33930
  context.levelDetails = levelDetails;
33927
33931
  this.handlePlaylistLoaded(levelDetails, response, stats, context, networkDetails, loader);
33928
- if (type === PlaylistContextType.MANIFEST && (!levelDetails.playlistParsingError || !levelDetails.fragments.length && levelDetails.live)) {
33929
- this.checkAutostartLoad();
33930
- }
33931
33932
  };
33932
33933
  _proto.handleManifestParsingError = function handleManifestParsingError(response, context, error, networkDetails, stats) {
33933
33934
  this.hls.trigger(Events.ERROR, {
@@ -34212,6 +34213,8 @@
34212
34213
  if (typeof onErrorOut === 'function') {
34213
34214
  this.on(Events.ERROR, onErrorOut, errorController);
34214
34215
  }
34216
+ // Autostart load handler
34217
+ this.on(Events.MANIFEST_LOADED, playListLoader.onManifestLoaded, playListLoader);
34215
34218
  }
34216
34219
  /**
34217
34220
  * Check if the required MediaSource Extensions are available.