1

I am using getUserMedia to get access to camera.while playing the captured video with getUserMedia. I want to stream and broadcast it to all user in my page as Live stream using ffmpeg and ffserver.

How would I post that stream to server(ffserver) for streaming it live?

Here is the code for getUserMedia part

window.addEventListener('DOMContentLoaded', function() {
  var v = document.getElementById('vlive');
  navigator.getUserMedia = (navigator.getUserMedia || navigator.webkitGetUserMedia 
   || navigator.mozGetUserMedia || navigator.msGetUserMedia);
  if (navigator.getUserMedia) {
    navigator.getUserMedia({
        video: true,
        audio: true,
      },
      function(stream) {
        var url = window.URL || window.webkitURL;
        v.src = url ? url.createObjectURL(stream) : stream;
        v.play();
      },
      function(error) {
        console.log('Good Job');
        alert('Something went wrong. (error code ' + error.code + ')');
        return;
      });
  } else {
    alert('Sorry, the browser you are using doesn\'t support getUserMedia');
    return;
  }
});
Durga
  • 15,263
  • 2
  • 28
  • 52
A Sahra
  • 118
  • 1
  • 12

0 Answers0