Skip to content

Commit

Permalink
fix(HLS): Avoid make a HEAD request of gap segments (#6880)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored Jun 21, 2024
1 parent a3e1fdd commit c90bc5f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4127,9 +4127,14 @@ shaka.hls.HlsParser = class {
'Playlist should have segments!');
const middleSegmentIdx = Math.trunc((playlist.segments.length - 1) / 2);

const middleSegment = playlist.segments[middleSegmentIdx];
if (shaka.hls.Utils.getFirstTagWithName(middleSegment.tags, 'EXT-X-GAP')) {
return this.guessMimeTypeFallback_(contentType);
}

const middleSegmentUris = shaka.hls.Utils.constructSegmentUris(
getUris(),
playlist.segments[middleSegmentIdx].verbatimSegmentUri,
middleSegment.verbatimSegmentUri,
variables);

const parsedUri = new goog.Uri(middleSegmentUris[0]);
Expand Down

0 comments on commit c90bc5f

Please sign in to comment.