Streaming a video file to an HTML5 video player with Node.js so that the video controls continue to work

HTMLWeb DevelopmentFront End Technology

Use createReadStream to send the requested part to the client. The function call createReadStream() will give you a readable stream. 


The following is the code −

stream = fs.createReadStream(path);
stream.on('open', function () {
      "Content-Range":"bytes " + begin + "-" + end + "/" +total, "Accept-Ranges":"bytes",
         "Content-Length":chunksize, "Content-Type":"new/mp4"
Published on 20-Mar-2018 15:57:26