title: Video stream through Websocket to <video> tag
body: <p>I use Node.js to stream via Websocket a realtime webm video to a webpage which will play it in a  tag.
  The following is the code from both the server and the client:</p>
  
  <p>SERVER:</p>
  
  <pre><code>var io = require('./libs/socket.io').listen(8080, {log:false});
  var fs = require('fs');
  io.sockets.on('connection', function (socket) 
  {
  console.log('sono entrato in connection');
  var readStream = fs.createReadStream("video.webm");
  
  socket.on('VIDEO_STREAM_REQ', function (req) 
  {
      console.log(req);
  
      readStream.addListener('data', function(data)
      {
          socket.emit('VS',data);
      });
  
  });
  });
  </code></pre>
  
  <p>CLIENT:</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  
  &lt;video id="v" autoplay&gt; &lt;/video&gt;
  
  &lt;script src='https://localhost/socket.io/socket.io.js'&gt;&lt;/script&gt;
  &lt;script&gt;
  window.URL = window.URL || window.webkitURL;
  window.MediaSource = window.MediaSource || window.WebKitMediaSource;
  
  if(!!! window.MediaSource)
  {
      alert('MediaSource API is not available!');
      return;
  }
  
  var mediaSource = new MediaSource();    
  var video = document.getElementById('v');
  
  video.src = window.URL.createObjectURL(mediaSource);
  
  mediaSource.addEventListener('webkitsourceopen', function(e)
  {
      var sourceBuffer = mediaSource.addSourceBuffer('video/webm; codecs="vorbis,vp8"');
      var socket = io.connect('http://localhost:8080');
  
      if(socket)
          console.log('Library retrieved!');
  
      socket.emit('VIDEO_STREAM_REQ','REQUEST');
  
      socket.on('VS', function (data) 
      {
          console.log(data);
          sourceBuffer.append(data);
      });
  });
  
  &lt;/script&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I'm using Chrome 26 and i get this error: "Uncaught Error: InvalidAccessError: DOM Exception 15". It seems like the type of the buffer fed to the append method is wrong. I already tried converting it in a Blob, Array and Uint8Array, but with no luck.</p>