- From: guest271314 <notifications@github.com>
- Date: Sun, 22 Mar 2020 15:16:12 -0700
- To: w3c/FileAPI <FileAPI@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/FileAPI/issues/147/602285027@github.com>
An `Array` containing `Uint8Array`s is being passed to the constructor, e.g., ``` const arr = []; arr.push(new Uint8Array([1]), new Uint8Array([2])); const blob = new Blob([arr]); const file = new File([arr], 'file'); blob.stream().getReader().read().then(({value, done}) => { console.assert(value.length === 3, value); console.log(value); }); file.stream().getReader().read().then(({value, done}) => { console.assert(value.length === 3, value); console.log(value); }); ``` however, the `length` of the input `Uint8Array`s have `length` substantially greater than `3` total, where the values are derived from `OffscreenCanvas.convertToBlob({type:"image/webp"})`, then `Blob.arrayBuffer()` is used where the result is passed to `Uint8Array()`. Those individual `Uint8Array`s are `push()` into a plain JavaScript ``Array` which is then passed to `Blob()` and `File()` constructors, respectively, in each case including `[result<Array>]` within constructor. Have not observed that particular behaviour in the past when using `File` or `Blob` constructors. The result should be consistent with the result of `MediaRecorder.ondataavailable` event being fired multiple times (or any other concatenation of `Array`, `TypedArray`, `Blob` or `File`), each `event.data<Blob>` being `push()`ed to an `Array` and the array being passed to `Blob` constructor. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/FileAPI/issues/147#issuecomment-602285027
Received on Sunday, 22 March 2020 22:16:25 UTC