Reputation: 628
Stack: Nextjs, expressjs, socket.io, WebRTC
I'm trying to build a video chat, at the moment everything works fine only if the second user joins and agrees to use the camera and has one at all. Otherwise, the connection is established, a chat is available between two users, but user 2 does not receive the video stream of user 1.
I put this code on github for more clarity and a better understanding of what is happening.
Very big cosmic thanks for help!
Upvotes: 0
Views: 74
Reputation: 17285
You are calling createOffer without the "legacy" offerToReceive* constraints. Without these, if the user creating the offer does not have a camera they will only negotiate audio and not attempt to negotiate video.
See https://webrtc.github.io/samples/src/content/peerconnection/pc1/ for a sample using those options.
Upvotes: 1