Search code examples
node.jsstreamvideo-streamingwebrtcsockjs

Stream data from Browser to nodejs server using getUserMedia


I'm trying to send data (video and audio) from Browser to a NodeJS server. On the client side, I'm using getUserMedia to get a stream data and trying to send it over websockets via SockJS. Here is my code so far :

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());
    })

Where mystream is a SockJS instance. My need is to persist the video as it is watched by a peer.

Has anyone ever sent a stream video to a server ? I'm out of ideas on this one. Any help/hint is appreciated.


Solution

  • After hours of researching, I just gave up and used Kurento. It is well documented and there is some pretty interesting examples involving NodeJS sample code. I let the question open in case someone comes with a better idea.