I have an video recorder application using StreamMediaRecorder JS API that has a PAUSE function. Whenever the user pauses the recording, a new blob slice should be saved and a big blob file should be saved at the end.
let chunks = [];
let player = document.getElementById('player');
recorder.ondataavailable = (event) => chunks.push(event.data);
recoder.onstop = (event) => {
var blob = new Blob([chunks], { type: 'octet/stream' });
player.src = URL.createObjectURL(blob);
}
However, every blob file is saved is just playing the last piece, not the whole file. After create the blob variable, the size is equals to the sum of all blob chunks, but when playing, only the last piece is being played.
Anyone knows how to solve it? Thank y'all!