First release
This commit is contained in:
commit
fa6c85266e
2339 changed files with 761050 additions and 0 deletions
41
node_modules/@videojs/http-streaming/src/decrypter-worker.js
generated
vendored
Normal file
41
node_modules/@videojs/http-streaming/src/decrypter-worker.js
generated
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
/* global self */
|
||||
import { Decrypter } from 'aes-decrypter';
|
||||
import { createTransferableMessage } from './bin-utils';
|
||||
|
||||
/**
|
||||
* Our web worker interface so that things can talk to aes-decrypter
|
||||
* that will be running in a web worker. the scope is passed to this by
|
||||
* webworkify.
|
||||
*/
|
||||
self.onmessage = function(event) {
|
||||
const data = event.data;
|
||||
const encrypted = new Uint8Array(
|
||||
data.encrypted.bytes,
|
||||
data.encrypted.byteOffset,
|
||||
data.encrypted.byteLength
|
||||
);
|
||||
const key = new Uint32Array(
|
||||
data.key.bytes,
|
||||
data.key.byteOffset,
|
||||
data.key.byteLength / 4
|
||||
);
|
||||
const iv = new Uint32Array(
|
||||
data.iv.bytes,
|
||||
data.iv.byteOffset,
|
||||
data.iv.byteLength / 4
|
||||
);
|
||||
|
||||
/* eslint-disable no-new, handle-callback-err */
|
||||
new Decrypter(
|
||||
encrypted,
|
||||
key,
|
||||
iv,
|
||||
function(err, bytes) {
|
||||
self.postMessage(createTransferableMessage({
|
||||
source: data.source,
|
||||
decrypted: bytes
|
||||
}), [bytes.buffer]);
|
||||
}
|
||||
);
|
||||
/* eslint-enable */
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue