I am trying to capture User media through navigator.mediaDevices.getUserMedia()
and then pipe the resultant stream to a socket io stream.
$(function(){
var socket = io('http://localhost:3000');
var outstream = ss.createStream();
navigator.mediaDevices.getUserMedia({audio: true, video: true})
.then(stream => {
console.log(stream);
ss(socket).emit('videoin', outstream);
stream.pipe(outstream);
})
})
But the code is throwing error stream.pipe is not a function
. I have already searched a lot on the web but have not got a good answer. There are some answers that suggest using WebRTC instead, but they are old and I think socketio stream didn't exist at that time.
What should I do?