Second RTCPeerConnection stuck in "connecting" state, while first connection successfully connects

Viewed 424

So I'm trying to set up a 3-way video call with WebRTC.

The first two connections connect fine. I have it set up so that the third person to join the room sends an offer to the first 2 sockets in the room (I'm using Node.js socket.io as a signalling server). The offer successfully sends to both sockets, and both sockets send back their answers. Both answers contain 1 audio track and 1 video track, however, for some reason, the connection only works with one of them.

The result is that with 3 users, the first user (usually) ends up seeing both peers, and then the second and third people only see one other person. When I look at the connectionState for each peer connection, one of them is stuck in "connecting", while everything else looks fine.

Here's a picture of the connection object

Any ideas?

1 Answers

Are you creating a new PeerConnection for the first two people in the room? When you say first 2 sockets it sounds like you are trying to use the same PeerConnection for multiple connections.

Each PeerConnection is only for a 1:1 connection. What you are trying to create is a Mesh Topology I believe.

Related