Skip to content

Commit

Permalink
fix: Fix usage of WebCrypto in old browsers (shaka-project#4711)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad committed Nov 15, 2022
1 parent 5697ea8 commit 9afce3b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/hls/hls_parser.js
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 9afce3b

Please sign in to comment.