F
F
fsockopen2016-10-01 15:27:54
JavaScript
fsockopen, 2016-10-01 15:27:54

How to transfer the video taken from the webcam to the socket / back to the html page?

There is a socket (socket.io) on nodeJs. The task is to take the stream (video) from the getUserMedia() function and pass it to the socket. Then back from the socket to the html page. Here is the code to make it clearer:

navigator.webkitGetUserMedia({video:true,audio: false},function (myStream){
    //передать myStream в сокет 
  }, function (error) { 
    console.log(error); 
  });

after the socket has accepted how to push it into the src of the video tag?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hbruser, 2016-10-02
@hbruser

MediaRecorder

mediaRecorder.ondataavailable = function(e) {
      chunks.push(e.data);
 }

And then you can send via socket.io.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question