-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
I am making a group video call app and I have been stuck here for a long time.
See like I have this small function:
const connectToNewUser = (id, stream) => {
const call = peerServer.call(id, stream);
call.on("stream", (userVideoStream) => {
if (userVideoStream) {
setremoteStream(...remoteStream, userVideoStream);
}
});
};
And It is simply being called here:
socket.on("user-connected", (id) => {
connectToNewUser(id, MyStream);
});
And listening for the event as follows:
peerServer.on("call", (call) => {
call.answer(MyStream);
call.on("stream", (remoteUserStream) => {
setstreams(...streams, remoteUserStream);
});
});
But I am getting this error:
ERROR [TypeError: undefined is not an object (evaluating 'call.on')]
What Should I do? I have made a same app in web with the code exactly the same as this but then y I am getting this error?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels