Constructor
new AesFileReadableStream()
Construct a wrapper do not use directly, use createFileReadableStream() instead.
Classes
Methods
(async) cancel(reasonopt)
Cancel the stream
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
reason |
any |
<optional> |
The reason |
(async) fillBuffer(cacheBuffer, startPosition, length)
Fills a cache buffer with the decrypted data from the encrypted source file.
Parameters:
Name | Type | Description |
---|---|---|
cacheBuffer |
Buffer | The cache buffer that will store the decrypted contents |
startPosition |
number | The start position |
length |
number | The length of the data requested |
getWorkerPath() → {string}
Get the worker path used for parallel streaming
Returns:
The worker path
- Type
- string
setWorkerPath(path)
Set the worker path
Parameters:
Name | Type | Description |
---|---|---|
path |
string | The worker path |
(static) createFileReadableStream(aesFile, buffersCount, bufferSize, threads, backOffset)
Creates a seekable stream from an encrypted file source
Parameters:
Name | Type | Default | Description |
---|---|---|---|
aesFile |
AesFile | The source file. | |
buffersCount |
number | 1 | Number of buffers to use. |
bufferSize |
Uint8Array | 524288 | The length of each buffer. |
threads |
number | 1 | The number of threads/streams to read the file in parallel. |
backOffset |
number | 32768 | The backwards offset. Some media libraries might request data rewinding the stream just a few bytes backwards. This ensures those bytes are included so we don't reset the stream. |