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.
@@ -59,10 +59,13 @@ export const enum HlsSkip {
59
59
  v2 = 'v2',
60
60
  }
61
61
 
62
- export function getSkipValue(details: LevelDetails, msn?: number): HlsSkip {
63
- const { canSkipUntil, canSkipDateRanges, endSN } = details;
64
- const snChangeGoal = msn !== undefined ? msn - endSN : 0;
65
- if (canSkipUntil && snChangeGoal < canSkipUntil) {
62
+ export function getSkipValue(details: LevelDetails): HlsSkip {
63
+ const { canSkipUntil, canSkipDateRanges, age } = details;
64
+ // A Client SHOULD NOT request a Playlist Delta Update unless it already
65
+ // has a version of the Playlist that is no older than one-half of the Skip Boundary.
66
+ // @see: https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#section-6.3.7
67
+ const playlistRecentEnough = age < canSkipUntil / 2;
68
+ if (canSkipUntil && playlistRecentEnough) {
66
69
  if (canSkipDateRanges) {
67
70
  return HlsSkip.v2;
68
71
  }