I want to display a video from a stream;
I have a nodeJS server sending an ogg video stream to the websocket port, and when the client connects to this port, it starts to receive the video stream data, but the following method does not seem to correctly understand the data as video ...
In the following context, βcameraβ is the identifier of the html5 video tag:
function connectWS() { var client = new BinaryClient('ws://192.168.161.193:8088'); client.on('stream', function(stream, meta) { stream.on('data', function(data) { var arrayBuffer = []; arrayBuffer.push(data); var video = new Blob([new Uint8Array(arrayBuffer)], { type: "video/ogg" }); document.getElementById('camera').src = (window.URL || window.webkitURL).createObjectURL(video); }); }); }
Someone seems to already have a video block running, but I can't find how ...
Display Javascript Blob Video
Thanks!
source share