Skip to content
This repository was archived by the owner on Apr 4, 2019. It is now read-only.

Failed to execute 'readAsArrayBuffer' on 'FileReader': parameter 1 is not of type 'Blob'. #4

Open
FrancescoMussi opened this issue Sep 28, 2018 · 2 comments

Comments

@FrancescoMussi
Copy link

Hello. This is package is exactly what I need.
Unfortunately it is not working.
Is it still active the project?

I am passing the array of blobs but I am getting the following error:

Failed to execute 'readAsArrayBuffer' on 'FileReader': parameter 1 is not of type 'Blob'.

screen shot 2018-09-28 at 17 56 02

I am simply calling the function and passing my array of blobs:

ConcatenateBlobs([this.blobArray], 'audio/wav', function(resultingBlob) {
  console.log({resultingBlob})
});

Do you know why this is happening?

Thanks!

@muaz-khan
Copy link
Owner

Please try this:

ConcatenateBlobs(this.blobArray, 'audio/wav', function(resultingBlob) {
  console.log({resultingBlob})
});

this.blobArray is an array object. So it should not be inside another array. Here is difference:

// invalid code
ConcatenateBlobs([this.blobArray], ....., .....);

// valid code
ConcatenateBlobs(this.blobArray, ....., .....);

Or to explain it clearly:

// invalid code
ConcatenateBlobs([[blob1, blob2, blob3, blob4]], ....., .....);

// valid code
ConcatenateBlobs([blob1, blob2, blob3, blob4], ....., .....);

@FrancescoMussi
Copy link
Author

Oh sorry! Such a stupid mistake!
I have fixed that. Now it doesn't give any error.
The final Blob seems to be properly created.

This is the console.log of the blobArray:
screen shot 2018-09-29 at 13 26 38

And this is the console.log of the resultingBlob:
screen shot 2018-09-29 at 13 26 44

But something weird is going on when I play the Blob.

If I download the blob, creating the url in this way: window.URL.createObjectURL(resultingBlob) and the open it in VLC, only the first video is played.

If I open the link in a new tab I can see video 1 + video 2 with their audio.
But the video2 it's only a freeze frame.

Do you know perhaps why this is happening?
Have you see a similar behavior?
If you use this package, the final video file will contain all the pieces one after another?

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants