I am recording my webcam with MediaRecoder and sending each blob back to sever using Websocket as such :
recorder = new MediaRecorder(canvasStream);
recorder.ondataavailable = e => {
ws.send(e.data)
}
which works fine, however I want to have more control over the type of message or data that will be send through Websocket and therefore I went with the classic
ws.send(JSON.stringify({ type: 'REC', data: e.data }))
to no avail. I cannot obviously Parse the data back on the server. How can I send a blob to the server while stringifying my message?
strigify? Surely there's an error on the browser console for this.ws.sendfunction does toe.datait could call thetoStringso try it,ws.send(JSON.stringify({ type: 'REC', data: e.data.toString() }))