title: Stream data from Browser to nodejs server using getUserMedia
body: <p>I'm trying to send data (video and audio) from Browser to a NodeJS server. On the client side, I'm using <a href="https://developer.mozilla.org/fr/docs/NavigatorUserMedia.getUserMedia" rel="nofollow noreferrer">getUserMedia</a> to get a stream data and trying to send it over websockets via <a href="https://github.com/sockjs/sockjs-client" rel="nofollow noreferrer">SockJS</a>. Here is my code so far :</p>
  
  <pre><code>navigator.mediaDevices.getUserMedia({
          audio: true,
          video: true
      })
      .then(function(stream){
         // trying to send stream
         var video = window.URL.createObjectURL(stream);
         // send stream
         mystream.send(video.play());
      })
  </code></pre>
  
  <p>Where <code>mystream</code> is a <code>SockJS</code> instance.
  My need is to persist the video as it is watched by a peer.</p>
  
  <p>Has anyone ever sent a stream video to a server ? I'm out of ideas on this one. Any help/hint is appreciated.</p>