From aedf634f8ee9a8f0a172bfaa0d9b7b3f8ba3f294 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Velad=20Galv=C3=A1n?= Date: Tue, 13 Jun 2023 21:25:01 +0200 Subject: [PATCH] feat(HLS): Allow delivery directives in Live streams (#5292) According to https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis#section-6.2.5 delivery directives are allowed for all live content --- lib/hls/hls_parser.js | 44 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/lib/hls/hls_parser.js b/lib/hls/hls_parser.js index 84cffd7a5c..c8e26ce720 100644 --- a/lib/hls/hls_parser.js +++ b/lib/hls/hls_parser.js @@ -345,29 +345,27 @@ shaka.hls.HlsParser = class { async updateStream_(streamInfo) { const manifestUri = streamInfo.absoluteMediaPlaylistUri; const uriObj = new goog.Uri(manifestUri); - if (this.lowLatencyMode_) { - const queryData = new goog.Uri.QueryData(); - if (streamInfo.canSkipSegments) { - // Enable delta updates. This will replace older segments with - // 'EXT-X-SKIP' tag in the media playlist. - queryData.add('_HLS_skip', 'YES'); - } - if (streamInfo.canBlockReload) { - if (streamInfo.nextMediaSequence >= 0) { - // Indicates that the server must hold the request until a Playlist - // contains a Media Segment with Media Sequence - queryData.add('_HLS_msn', String(streamInfo.nextMediaSequence)); - } - if (streamInfo.nextPart >= 0) { - // Indicates, in combination with _HLS_msn, that the server must hold - // the request until a Playlist contains Partial Segment N of Media - // Sequence Number M or later. - queryData.add('_HLS_part', String(streamInfo.nextPart)); - } - } - if (queryData.getCount()) { - uriObj.setQueryData(queryData); - } + const queryData = new goog.Uri.QueryData(); + if (streamInfo.canSkipSegments) { + // Enable delta updates. This will replace older segments with + // 'EXT-X-SKIP' tag in the media playlist. + queryData.add('_HLS_skip', 'YES'); + } + if (streamInfo.canBlockReload) { + if (streamInfo.nextMediaSequence >= 0) { + // Indicates that the server must hold the request until a Playlist + // contains a Media Segment with Media Sequence + queryData.add('_HLS_msn', String(streamInfo.nextMediaSequence)); + } + if (streamInfo.nextPart >= 0) { + // Indicates, in combination with _HLS_msn, that the server must hold + // the request until a Playlist contains Partial Segment N of Media + // Sequence Number M or later. + queryData.add('_HLS_part', String(streamInfo.nextPart)); + } + } + if (queryData.getCount()) { + uriObj.setQueryData(queryData); } const response = await this.requestManifest_(uriObj.toString(), /* isPlaylist= */ true);