@tianfeng98/hls.js
Version:
HLS.js is a JavaScript library that supports playing MPEG-TS and HEVC encoded HLS streams in browsers with support for MSE.
14 lines (11 loc) • 334 B
text/typescript
export default class AESCrypto {
private subtle: SubtleCrypto;
private aesIV: Uint8Array;
constructor(subtle: SubtleCrypto, iv: Uint8Array) {
this.subtle = subtle;
this.aesIV = iv;
}
decrypt(data: ArrayBuffer, key: CryptoKey) {
return this.subtle.decrypt({ name: 'AES-CBC', iv: this.aesIV }, key, data);
}
}