I am sending a socket.io event holding different values including webcam stream but I am consoling the event data in nodejs and I am getting empty object. what can I do to get the stream.
If I console stream on client side before sending event I get it.
here is the client code (angular 12)
toggleVideoCall(){
this.toggleVideo = false;
let mediaDevices = navigator.mediaDevices;
mediaDevices.getUserMedia({
video: true,
audio: true
})
.then((stream:MediaStream)=>{
this.addMyVideo(stream);
console.log(stream);
this.socket.emit("call", {callerStream: stream,callerName: this.myname,callerId: this.myId,recieverName: this.userToCall.username, reciever: this.userToCall._id});
})
.catch(alert)
}
here is nodejs socket.io
io.on("connection", (socket) => {
socket.on("call", (data)=>{
console.log(data)
io.emit("pickCall", data);
})
})