title: Display video stream chunks on page (node.js)
body: <p>I'm still new in Node.js and trying to figure out things so excuse me if I sound incoherent.</p>
  
  <p>So I've read some beginner notes on streams and I'm testing it out at the moment.
  I got these Seinfeld episodes (.mkv files) in my project files (public/images/videos/Seinfeld.S09E07.720p.WebRip.ReEnc-DeeJayAhmed.mkv) that I would like to show on a page. Now, the easy choice would be to just put it in the 'src' of the video tag in my ejs file. </p>
  
  <p>However, I would like to stream the video parts so that it doesn't have to wait for the whole file to be ready to display the episode. I thought I could use .createReadStream for this. However, I don't know how I can transfer those little chunks of video data that are ready into my webpage to display them in my video player. </p>
  
  <p><em>index.js server-side</em></p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  var fs = require('fs');
  
      /* GET home page. */
  router.get('/', function(req, res, next) {
      var myReadStream = fs.createReadStream(__dirname + '/../images/videos/Seinfeld.S09E07.720p.WebRip.ReEnc-DeeJayAhmed.mkv');
  
      myReadStream.on('data', function (chunk) {
          // no idea what to do from here
      })
      res.render('index', {
          title: 'Express'
          });
  });
  
  module.exports = router;
  </code></pre>
  
  <p>EJS file</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
    &lt;head&gt;
      &lt;title&gt;&lt;%= title %&gt;&lt;/title&gt;
      &lt;link rel='stylesheet' href='/stylesheets/style.css' /&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;&lt;%= title %&gt;&lt;/h1&gt;
      &lt;video src="" type="video/mkv" autoplay controls&gt;&lt;/video&gt;
      &lt;p&gt;Welcome to &lt;%= title %&gt;&lt;/p&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>