Skip to content

Commit

Permalink
fix: Fix usage of WebCrypto in old browsers (#4711)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored and joeyparrish committed Dec 8, 2022
1 parent 199c35e commit 2fec68b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2156,8 +2156,11 @@ shaka.hls.HlsParser = class {
shaka.util.Error.Code.HLS_AES_128_INVALID_KEY_LENGTH);
}

const algorithm = {
name: 'AES-CBC',
};
keyInfo.cryptoKey = await window.crypto.subtle.importKey(
'raw', keyResponse.data, 'AES-CBC', true, ['decrypt']);
'raw', keyResponse.data, algorithm, true, ['decrypt']);
keyInfo.fetchKey = undefined; // No longer needed.
};

Expand Down

0 comments on commit 2fec68b

Please sign in to comment.