I’ve been trying to implement group video calling using MediaSoup, following the documentation carefully, but it’s not working as expected. Here’s the flow of my app:
- Client 1 (Sender):
- Joins a room, gets RTP capabilities, and loads the device.
- Creates a WebRTC transport on the server for receiving media (
consumer=true
) and sends transport details to the client. - Creates a
recvTransport
on the client and attaches aconnect
event to send the transport ID and DTLS parameters back to the server. - The server connects the transport and checks for producers in the room. If producers exist, it consumes their media and sends the data to the client.
- The client maps through the consumed data and calls
consume
on therecvTransport
. - If camera permission is denied, the process stops. Otherwise:
- Creates a WebRTC transport on the server for sending media (
consumer=false
) and uses the returned transport data to create asendTransport
on the client. - Attaches
connect
andproduce
event listeners to thesendTransport
and sends the necessary parameters to the server to connect the transport and create a producer.
- Creates a WebRTC transport on the server for sending media (
- Client 2 (Receiver):
- Joins the same room, gets RTP capabilities, and loads the device.
- Since camera permission is off, only creates a WebRTC transport on the server for receiving media (
consumer=true
) and sends transport details to the client. - Creates a
recvTransport
on the client and attaches aconnect
event to send the transport ID and DTLS parameters back to the server. - The server connects the transport, checks for producers in the room, consumes their media, and sends the consumed data to the client.
- The client maps through the consumed data and calls
consume
on therecvTransport
.