hls.js 1.5.14-0.canary.10606 → 1.5.14-0.canary.10609

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.
@@ -421,7 +421,7 @@ function enableLogs(debugConfig, context, id) {
421
421
  // Some browsers don't allow to use bind on console object anyway
422
422
  // fallback to default if needed
423
423
  try {
424
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.14-0.canary.10606"}`);
424
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.14-0.canary.10609"}`);
425
425
  } catch (e) {
426
426
  /* log fn threw an exception. All logger methods are no-ops. */
427
427
  return createLogger();
@@ -5254,13 +5254,24 @@ function mapFragmentIntersection(oldDetails, newDetails, intersectionFn) {
5254
5254
  }
5255
5255
  }
5256
5256
  }
5257
- function adjustSliding(oldDetails, newDetails) {
5257
+ function adjustSliding(oldDetails, newDetails, matchingStableVariantOrRendition = true) {
5258
5258
  const delta = newDetails.startSN + newDetails.skippedSegments - oldDetails.startSN;
5259
5259
  const oldFragments = oldDetails.fragments;
5260
- if (delta < 0 || delta >= oldFragments.length) {
5260
+ const advancedOrStable = delta >= 0;
5261
+ let sliding = 0;
5262
+ if (advancedOrStable && delta < oldFragments.length) {
5263
+ sliding = oldFragments[delta].start;
5264
+ } else if (advancedOrStable && matchingStableVariantOrRendition) {
5265
+ // align new start with old end (updated playlist start sequence is past end sequence of last update)
5266
+ sliding = oldDetails.edge;
5267
+ } else if (!newDetails.skippedSegments && newDetails.fragments[0].start === 0) {
5268
+ // align new start with old (playlist switch has a sequence with no overlap and should not be used for alignment)
5269
+ sliding = oldDetails.fragments[0].start;
5270
+ } else {
5271
+ // new details already has a sliding offset or has skipped segments
5261
5272
  return;
5262
5273
  }
5263
- addSliding(newDetails, oldFragments[delta].start);
5274
+ addSliding(newDetails, sliding);
5264
5275
  }
5265
5276
  function addSliding(details, start) {
5266
5277
  if (start) {
@@ -11892,7 +11903,7 @@ function alignStream(lastFrag, switchDetails, details) {
11892
11903
  // Try to align on sn so that we pick a better start fragment.
11893
11904
  // Do not perform this on playlists with delta updates as this is only to align levels on switch
11894
11905
  // and adjustSliding only adjusts fragments after skippedSegments.
11895
- adjustSliding(switchDetails, details);
11906
+ adjustSliding(switchDetails, details, false);
11896
11907
  }
11897
11908
  }
11898
11909
 
@@ -13867,7 +13878,7 @@ function changeTypeSupported() {
13867
13878
  return typeof (sourceBuffer == null ? void 0 : (_sourceBuffer$prototy = sourceBuffer.prototype) == null ? void 0 : _sourceBuffer$prototy.changeType) === 'function';
13868
13879
  }
13869
13880
 
13870
- const version = "1.5.14-0.canary.10606";
13881
+ const version = "1.5.14-0.canary.10609";
13871
13882
 
13872
13883
  // ensure the worker ends up in the bundle
13873
13884
  // If the worker should not be included this gets aliased to empty.js