I'm building a camera streaming platform that uses navigator.getUserMedia. The clients seem to broadcast their video streams without error. The code (on clients) for doing so looks like this:
navigator.mediaDevices.getUserMedia({ audio: false, //We don't need audio at the moment video: true }).then(function(stream) { ss(socket).emit("BroadcastStream", stream); }).catch(err) { //Code for handling error });However my Node.JS server handling the stream (and sending it to the other client) throws this error:
TypeError: socket_stream(...).to is not a function
It seems socket.io-stream isn't exposing the .to function. I know the argument to socket_stream (reference to the socket.io instance) is valid; and socket.io-stream's documentation seems to agree with this (there is no mention of .to)
How would I go around resolving this? EDIT: I am open to suggestions (even using a different method altogether; but leave that as a last resort)