hls.js 1.5.8-0.canary.10155 → 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.js CHANGED
@@ -637,7 +637,7 @@
637
637
  // Some browsers don't allow to use bind on console object anyway
638
638
  // fallback to default if needed
639
639
  try {
640
- newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.8-0.canary.10155");
640
+ newLogger.log("Debug logs enabled for \"" + context + "\" in hls.js version " + "1.5.8-0.canary.10157");
641
641
  } catch (e) {
642
642
  /* log fn threw an exception. All logger methods are no-ops. */
643
643
  return createLogger();
@@ -5462,12 +5462,15 @@
5462
5462
  Yes: "YES",
5463
5463
  v2: "v2"
5464
5464
  };
5465
- function getSkipValue(details, msn) {
5465
+ function getSkipValue(details) {
5466
5466
  var canSkipUntil = details.canSkipUntil,
5467
5467
  canSkipDateRanges = details.canSkipDateRanges,
5468
- endSN = details.endSN;
5469
- var snChangeGoal = msn !== undefined ? msn - endSN : 0;
5470
- if (canSkipUntil && snChangeGoal < canSkipUntil) {
5468
+ age = details.age;
5469
+ // A Client SHOULD NOT request a Playlist Delta Update unless it already
5470
+ // has a version of the Playlist that is no older than one-half of the Skip Boundary.
5471
+ // @see: https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#section-6.3.7
5472
+ var playlistRecentEnough = age < canSkipUntil / 2;
5473
+ if (canSkipUntil && playlistRecentEnough) {
5471
5474
  if (canSkipDateRanges) {
5472
5475
  return HlsSkip.v2;
5473
5476
  }
@@ -6653,7 +6656,7 @@
6653
6656
  this.canLoad = false;
6654
6657
  this.clearTimer();
6655
6658
  };
6656
- _proto.switchParams = function switchParams(playlistUri, previous) {
6659
+ _proto.switchParams = function switchParams(playlistUri, previous, current) {
6657
6660
  var renditionReports = previous == null ? void 0 : previous.renditionReports;
6658
6661
  if (renditionReports) {
6659
6662
  var foundIndex = -1;
@@ -6685,7 +6688,8 @@
6685
6688
  part += 1;
6686
6689
  }
6687
6690
  }
6688
- return new HlsUrlParameters(msn, part >= 0 ? part : undefined, HlsSkip.No);
6691
+ var skip = current && getSkipValue(current);
6692
+ return new HlsUrlParameters(msn, part >= 0 ? part : undefined, skip);
6689
6693
  }
6690
6694
  }
6691
6695
  };
@@ -6819,7 +6823,7 @@
6819
6823
  }
6820
6824
  };
6821
6825
  _proto.getDeliveryDirectives = function getDeliveryDirectives(details, previousDeliveryDirectives, msn, part) {
6822
- var skip = getSkipValue(details, msn);
6826
+ var skip = getSkipValue(details);
6823
6827
  if (previousDeliveryDirectives != null && previousDeliveryDirectives.skip && details.deltaUpdateFailed) {
6824
6828
  msn = previousDeliveryDirectives.msn;
6825
6829
  part = previousDeliveryDirectives.part;
@@ -18392,7 +18396,7 @@
18392
18396
  if (trackLoaded) {
18393
18397
  return;
18394
18398
  }
18395
- var hlsUrlParameters = this.switchParams(track.url, lastTrack == null ? void 0 : lastTrack.details);
18399
+ var hlsUrlParameters = this.switchParams(track.url, lastTrack == null ? void 0 : lastTrack.details, track.details);
18396
18400
  this.loadPlaylist(hlsUrlParameters);
18397
18401
  };
18398
18402
  _proto.findTrackId = function findTrackId(currentTrack) {
@@ -19286,7 +19290,7 @@
19286
19290
  type: type,
19287
19291
  url: url
19288
19292
  });
19289
- var hlsUrlParameters = this.switchParams(track.url, lastTrack == null ? void 0 : lastTrack.details);
19293
+ var hlsUrlParameters = this.switchParams(track.url, lastTrack == null ? void 0 : lastTrack.details, track.details);
19290
19294
  this.loadPlaylist(hlsUrlParameters);
19291
19295
  };
19292
19296
  return _createClass(SubtitleTrackController, [{
@@ -27784,7 +27788,7 @@
27784
27788
  var levelDetails = level.details;
27785
27789
  if (!levelDetails || levelDetails.live) {
27786
27790
  // level not retrieved yet, or live playlist we need to (re)load it
27787
- var hlsUrlParameters = this.switchParams(level.uri, lastLevel == null ? void 0 : lastLevel.details);
27791
+ var hlsUrlParameters = this.switchParams(level.uri, lastLevel == null ? void 0 : lastLevel.details, levelDetails);
27788
27792
  this.loadPlaylist(hlsUrlParameters);
27789
27793
  }
27790
27794
  }
@@ -30458,7 +30462,7 @@
30458
30462
  * Get the video-dev/hls.js package version.
30459
30463
  */
30460
30464
  function get() {
30461
- return "1.5.8-0.canary.10155";
30465
+ return "1.5.8-0.canary.10157";
30462
30466
  }
30463
30467
  }, {
30464
30468
  key: "Events",
package/dist/hls.js.d.ts CHANGED
@@ -197,7 +197,7 @@ export declare class BasePlaylistController extends Logger implements NetworkCom
197
197
  protected clearTimer(): void;
198
198
  startLoad(): void;
199
199
  stopLoad(): void;
200
- protected switchParams(playlistUri: string, previous: LevelDetails | undefined): HlsUrlParameters | undefined;
200
+ protected switchParams(playlistUri: string, previous: LevelDetails | undefined, current: LevelDetails | undefined): HlsUrlParameters | undefined;
201
201
  protected loadPlaylist(hlsUrlParameters?: HlsUrlParameters): void;
202
202
  protected shouldLoadPlaylist(playlist: Level | MediaPlaylist | null | undefined): boolean;
203
203
  protected shouldReloadPlaylist(playlist: Level | MediaPlaylist | null | undefined): boolean;