hls.js 1.5.17-0.canary.10681 → 1.5.17-0.canary.10684

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.
@@ -1045,7 +1045,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`,
1045
1045
  });
1046
1046
  }
1047
1047
  const assetListLength = interstitial.assetList.length;
1048
- if (assetListLength === 0) {
1048
+ if (assetListLength === 0 && !interstitial.assetListResponse) {
1049
1049
  // Waiting at end of primary content segment
1050
1050
  // Expect setSchedulePosition to be called again once ASSET-LIST is loaded
1051
1051
  this.log(`Waiting for ASSET-LIST to complete loading ${interstitial}`);
@@ -1064,29 +1064,25 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`,
1064
1064
  // Update schedule and asset list position now that it can start
1065
1065
  this.waitingItem = null;
1066
1066
  this.playingItem = scheduledItem;
1067
- // Start Interstitial Playback
1067
+
1068
+ // If asset-list is empty or missing asset index, advance to next item
1068
1069
  const assetItem = interstitial.assetList[assetListIndex];
1069
1070
  if (!assetItem) {
1070
- const error = new Error(
1071
- `ASSET-LIST index ${assetListIndex} out of bounds [0-${
1072
- assetListLength - 1
1073
- }] ${interstitial}`,
1074
- );
1075
- const errorData: ErrorData = {
1076
- fatal: true,
1077
- type: ErrorTypes.OTHER_ERROR,
1078
- details: ErrorDetails.INTERSTITIAL_ASSET_ITEM_ERROR,
1079
- error,
1080
- };
1081
- this.handleAssetItemError(
1082
- errorData,
1083
- interstitial,
1084
- index,
1085
- assetListIndex,
1086
- error.message,
1087
- );
1071
+ const nextItem = scheduleItems[index + 1];
1072
+ const media = this.media;
1073
+ if (
1074
+ nextItem &&
1075
+ media &&
1076
+ !this.isInterstitial(nextItem) &&
1077
+ media.currentTime < nextItem.start
1078
+ ) {
1079
+ media.currentTime = this.timelinePos = nextItem.start;
1080
+ }
1081
+ this.advanceAfterAssetEnded(interstitial, index, assetListIndex || 0);
1088
1082
  return;
1089
1083
  }
1084
+
1085
+ // Start Interstitial Playback
1090
1086
  if (!player) {
1091
1087
  player = this.getAssetPlayer(assetItem.identifier);
1092
1088
  }
@@ -1411,7 +1407,7 @@ MediaSource ${JSON.stringify(attachMediaSourceData)} from ${logFromSource}`,
1411
1407
  interstitialEvents.forEach((event) => (event.appendInPlace = false));
1412
1408
  }
1413
1409
  this.log(
1414
- `Interstitial events (${
1410
+ `INTERSTITIALS_UPDATED (${
1415
1411
  interstitialEvents.length
1416
1412
  }): ${interstitialEvents}
1417
1413
  Schedule: ${scheduleItems.map((seg) => segmentToString(seg))}`,