How to get video bytes from react-video-recorder

Viewed 195

I'm saving the video bytes from react-video-recorder, however, the video isn't a valid webm video file. Here is a piece of my code:

const onVideoChange = (video) => { video.arrayBuffer().then((arrayBuffer) => { dispatch( submitVideo( [ { name: "video.webm", bytes: new Uint8Array(arrayBuffer), }, ], submitVideoCallback ) ); }); };

on renders: VideoRecorder onRecordingComplete={onVideoChange}

When I receive the video bytes on the back-end and save the video file like video.webm, VLC isn't able to play it.

What I'm doing wrong?

Thanks Sergio Stateri Junior.

0 Answers
Related