Sorry to ask this, as I know there have been a few similar threads, but nothing helped me work it out.
I’ve used mediasoup successfully in the past, but I seem to be stuck just trying to make a simple producer connection now, and I don’t know how to debug it.
Simplified version of my code:
producerTransport.on("connect", async ({ dtlsParameters }) => {
socket.emit("connectProducerTransport", { dtlsParameters }, () => {
console.log("this is logged and debug logs say connection succeeded");
});
});
producerTransport.on(
"produce",
async (clientProduceParameters, callback) => {
console.log("this is never logged")
socket.emit("produce", clientProduceParameters, ({ id }) => {
callback({ id });
console.log("so this is never logged")
});
}
);
await producerTransport.produce({
track,
...params,
});
console.log("this is never logged")
I hope this makes the issue clear. Originally I was running the server in a docker container, and the front end was react native, but I’ve simplified everything so it’s just a node server running locally and react in a web browser and I still have the same problem.
I guessed it could be an ssl issue, so I’m running the frontend as https with trusted certs via mkcert, but that hasn’t fixed it. I also tried using my generated server certs in mediasoup’s dtlsCertificateFile / dtlsPrivateKeyFile but no change.
I’ve tried various ip settings, such as:
{
ip: "0.0.0.0", announcedIp: "127.0.0.1"
},
And:
{
ip: "127.0.0.1", announcedIp: null
},
And even getting the ip via os.networkInterfaces() etc.
I’m not really sure where to go from here. The documentation here says: “The transport will emit “produce” so the application will transmit the event parameters to the server and will create a Producer instance in server side.” but I’m not sure what to do if it doesn’t.
I’ve turned on the debugging with DEBUG="mediasoup*"
but this is the last bit of info I get:
[Node] 2022-11-17T19:16:12.251Z mediasoup:WebRtcTransport connect()
[Node] 2022-11-17T19:16:12.252Z mediasoup:Channel request() [method:transport.connect, id:4]
[Node] 2022-11-17T19:16:12.255Z mediasoup:Channel request succeeded [method:transport.connect, id:4]
I’d be really glad of any suggestions for other things to try, or if there’s a more concrete method of working out what’s wrong that I should be following. If it makes any difference, I’m on an M1 mac, but had no problems installing, and like I say, I’ve tried docker as well. I’m using chrome://webrtc-internals/
but maybe I’m missing something?