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.
package/dist/hls.light.js CHANGED
@@ -606,7 +606,7 @@
606
606
  // Some browsers don't allow to use bind on console object anyway
607
607
  // fallback to default if needed
608
608
  try {
609
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.8-0.canary.10156");
609
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.8-0.canary.10157");
610
610
  } catch (e) {
611
611
  /* log fn threw an exception. All logger methods are no-ops. */
612
612
  return createLogger();
@@ -4819,12 +4819,15 @@
4819
4819
  Yes: "YES",
4820
4820
  v2: "v2"
4821
4821
  };
4822
- function getSkipValue(details, msn) {
4822
+ function getSkipValue(details) {
4823
4823
  var canSkipUntil = details.canSkipUntil,
4824
4824
  canSkipDateRanges = details.canSkipDateRanges,
4825
- endSN = details.endSN;
4826
- var snChangeGoal = msn !== undefined ? msn - endSN : 0;
4827
- if (canSkipUntil && snChangeGoal < canSkipUntil) {
4825
+ age = details.age;
4826
+ // A Client SHOULD NOT request a Playlist Delta Update unless it already
4827
+ // has a version of the Playlist that is no older than one-half of the Skip Boundary.
4828
+ // @see: https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#section-6.3.7
4829
+ var playlistRecentEnough = age < canSkipUntil / 2;
4830
+ if (canSkipUntil && playlistRecentEnough) {
4828
4831
  if (canSkipDateRanges) {
4829
4832
  return HlsSkip.v2;
4830
4833
  }
@@ -6010,7 +6013,7 @@
6010
6013
  this.canLoad = false;
6011
6014
  this.clearTimer();
6012
6015
  };
6013
- _proto.switchParams = function switchParams(playlistUri, previous) {
6016
+ _proto.switchParams = function switchParams(playlistUri, previous, current) {
6014
6017
  var renditionReports = previous == null ? void 0 : previous.renditionReports;
6015
6018
  if (renditionReports) {
6016
6019
  var foundIndex = -1;
@@ -6042,7 +6045,8 @@
6042
6045
  part += 1;
6043
6046
  }
6044
6047
  }
6045
- return new HlsUrlParameters(msn, part >= 0 ? part : undefined, HlsSkip.No);
6048
+ var skip = current && getSkipValue(current);
6049
+ return new HlsUrlParameters(msn, part >= 0 ? part : undefined, skip);
6046
6050
  }
6047
6051
  }
6048
6052
  };
@@ -6176,7 +6180,7 @@
6176
6180
  }
6177
6181
  };
6178
6182
  _proto.getDeliveryDirectives = function getDeliveryDirectives(details, previousDeliveryDirectives, msn, part) {
6179
- var skip = getSkipValue(details, msn);
6183
+ var skip = getSkipValue(details);
6180
6184
  if (previousDeliveryDirectives != null && previousDeliveryDirectives.skip && details.deltaUpdateFailed) {
6181
6185
  msn = previousDeliveryDirectives.msn;
6182
6186
  part = previousDeliveryDirectives.part;
@@ -10655,7 +10659,7 @@
10655
10659
  var levelDetails = level.details;
10656
10660
  if (!levelDetails || levelDetails.live) {
10657
10661
  // level not retrieved yet, or live playlist we need to (re)load it
10658
- var hlsUrlParameters = this.switchParams(level.uri, lastLevel == null ? void 0 : lastLevel.details);
10662
+ var hlsUrlParameters = this.switchParams(level.uri, lastLevel == null ? void 0 : lastLevel.details, levelDetails);
10659
10663
  this.loadPlaylist(hlsUrlParameters);
10660
10664
  }
10661
10665
  }
@@ -21684,7 +21688,7 @@
21684
21688
  * Get the video-dev/hls.js package version.
21685
21689
  */
21686
21690
  function get() {
21687
- return "1.5.8-0.canary.10156";
21691
+ return "1.5.8-0.canary.10157";
21688
21692
  }
21689
21693
  }, {
21690
21694
  key: "Events",