Skip to content

Commit

Permalink
fix(HLS): Ignore query params in the uri of EXT-X-SESSION-KEY tags (#…
Browse files Browse the repository at this point in the history
…6755)

With this change avoids errors like: 
`DOMException: Failed to execute 'atob' on 'Window': The string to be
decoded is not correctly encoded.`
  • Loading branch information
avelad committed Jun 7, 2024
1 parent 62f860e commit 36425bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4224,7 +4224,7 @@ shaka.hls.HlsParser = class {
}

const uri = drmTag.getRequiredAttrValue('URI');
const parsedData = shaka.net.DataUriPlugin.parseRaw(uri);
const parsedData = shaka.net.DataUriPlugin.parseRaw(uri.split('?')[0]);

// The data encoded in the URI is a PSSH box to be used as init data.
const pssh = shaka.util.BufferUtils.toUint8(parsedData.data);
Expand Down Expand Up @@ -4267,7 +4267,7 @@ shaka.hls.HlsParser = class {
}

const uri = drmTag.getRequiredAttrValue('URI');
const parsedData = shaka.net.DataUriPlugin.parseRaw(uri);
const parsedData = shaka.net.DataUriPlugin.parseRaw(uri.split('?')[0]);

// The data encoded in the URI is a PlayReady Pro Object, so we need
// convert it to pssh.
Expand Down

0 comments on commit 36425bd

Please sign in to comment.