hls.js 1.5.8-0.canary.10156 → 1.5.8-0.canary.10157

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.
@@ -512,7 +512,7 @@ function enableLogs(debugConfig, context, id) {
512
512
  // Some browsers don't allow to use bind on console object anyway
513
513
  // fallback to default if needed
514
514
  try {
515
- newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.8-0.canary.10156"}`);
515
+ newLogger.log(`Debug logs enabled for "${context}" in hls.js version ${"1.5.8-0.canary.10157"}`);
516
516
  } catch (e) {
517
517
  /* log fn threw an exception. All logger methods are no-ops. */
518
518
  return createLogger();
@@ -4629,14 +4629,17 @@ var HlsSkip = {
4629
4629
  Yes: "YES",
4630
4630
  v2: "v2"
4631
4631
  };
4632
- function getSkipValue(details, msn) {
4632
+ function getSkipValue(details) {
4633
4633
  const {
4634
4634
  canSkipUntil,
4635
4635
  canSkipDateRanges,
4636
- endSN
4636
+ age
4637
4637
  } = details;
4638
- const snChangeGoal = msn !== undefined ? msn - endSN : 0;
4639
- if (canSkipUntil && snChangeGoal < canSkipUntil) {
4638
+ // A Client SHOULD NOT request a Playlist Delta Update unless it already
4639
+ // has a version of the Playlist that is no older than one-half of the Skip Boundary.
4640
+ // @see: https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#section-6.3.7
4641
+ const playlistRecentEnough = age < canSkipUntil / 2;
4642
+ if (canSkipUntil && playlistRecentEnough) {
4640
4643
  if (canSkipDateRanges) {
4641
4644
  return HlsSkip.v2;
4642
4645
  }
@@ -5754,7 +5757,7 @@ class BasePlaylistController extends Logger {
5754
5757
  this.canLoad = false;
5755
5758
  this.clearTimer();
5756
5759
  }
5757
- switchParams(playlistUri, previous) {
5760
+ switchParams(playlistUri, previous, current) {
5758
5761
  const renditionReports = previous == null ? void 0 : previous.renditionReports;
5759
5762
  if (renditionReports) {
5760
5763
  let foundIndex = -1;
@@ -5786,7 +5789,8 @@ class BasePlaylistController extends Logger {
5786
5789
  part += 1;
5787
5790
  }
5788
5791
  }
5789
- return new HlsUrlParameters(msn, part >= 0 ? part : undefined, HlsSkip.No);
5792
+ const skip = current && getSkipValue(current);
5793
+ return new HlsUrlParameters(msn, part >= 0 ? part : undefined, skip);
5790
5794
  }
5791
5795
  }
5792
5796
  }
@@ -5919,7 +5923,7 @@ class BasePlaylistController extends Logger {
5919
5923
  }
5920
5924
  }
5921
5925
  getDeliveryDirectives(details, previousDeliveryDirectives, msn, part) {
5922
- let skip = getSkipValue(details, msn);
5926
+ let skip = getSkipValue(details);
5923
5927
  if (previousDeliveryDirectives != null && previousDeliveryDirectives.skip && details.deltaUpdateFailed) {
5924
5928
  msn = previousDeliveryDirectives.msn;
5925
5929
  part = previousDeliveryDirectives.part;
@@ -10231,7 +10235,7 @@ class LevelController extends BasePlaylistController {
10231
10235
  const levelDetails = level.details;
10232
10236
  if (!levelDetails || levelDetails.live) {
10233
10237
  // level not retrieved yet, or live playlist we need to (re)load it
10234
- const hlsUrlParameters = this.switchParams(level.uri, lastLevel == null ? void 0 : lastLevel.details);
10238
+ const hlsUrlParameters = this.switchParams(level.uri, lastLevel == null ? void 0 : lastLevel.details, levelDetails);
10235
10239
  this.loadPlaylist(hlsUrlParameters);
10236
10240
  }
10237
10241
  }
@@ -20355,7 +20359,7 @@ class Hls {
20355
20359
  * Get the video-dev/hls.js package version.
20356
20360
  */
20357
20361
  static get version() {
20358
- return "1.5.8-0.canary.10156";
20362
+ return "1.5.8-0.canary.10157";
20359
20363
  }
20360
20364
 
20361
20365
  /**