1

I am new to webRTC. I have built one streaming server in node.js which is working fine with uploaded mp4 files. Now I succeeded to access webcam in HTML5 with webRTC with code bellow

if (!navigator.getUserMedia) { navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia; }

          if (!navigator.getUserMedia){
             alert('getUserMedia not supported in this browser.');
          }

          navigator.getUserMedia(mediaOptions, success, function(e) {
            console.log(e);
          });
          function success(stream){
            var video = document.querySelector("#player");
            video.src = window.URL.createObjectURL(stream);


            socket.emit('my other event', { my: stream});


          }

As you can see I am sending the stream but in server end I am getting nothing. But another data I am getting. Please help !

1 Answers1

0

The stream you are sending is not "the streaming of the media" for audio you have to use the WebAudioAPI ScriptProcessorNode

https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html#ScriptProcessorNode https://developer.mozilla.org/en-US/docs/Web/API/ScriptProcessorNode

For video is not so straightforward, you have to use a canvas to get the video data, sse this thread Get raw pixel data from HTML5 video

Community
  • 1
  • 1
pmarques
  • 31
  • 1