title: how to make node js online video streaming
body: <p>here is my node js code</p>
  
  <pre><code>socket.on('stream',()=&gt;{
          let  readStream = fs.createReadStream(__dirname+'/video.mp4');
          readStream.on('data',(chunk)=&gt;{
  
             socket.emit('stream-chunk',chunk);
              //res.render("hello");
          });
      });
  </code></pre>
  
  <p>and here is the client side </p>
  
  <pre><code>            let chunkArray = [];
              socket.on('stream-chunk', (chunk) =&gt; { 
                      chunkArray.push(chunk);
                      //console.log(chunk);
                      //var url = URL.createObjectURL(chunk);
                      //alert(url);
                      $("#video").attr("src",url);
  
              });
  </code></pre>
  
  <p>so as you can see I just want to get a video file from node server and stream it using buffers.. so far the chunks come as ArrayBuffers to client side. But I have no idea how to make use this incoming chunks to my html5 <code>&lt;video&gt;</code> element </p>
  
  <p>here is my client side html tag</p>
  
  <pre><code>&lt;video controls type="video/mp4" src="" id="video" width="300" height="300"&gt;&lt;/video&gt;
  </code></pre>