I have made changes to the mediasoup server made by another programmer years ago. In local, when producing/consuming video, the video stream works perfectly fine, meaning:
the video stream is not muted.
producerScore and score for consumer are both 10.
When deploying client and server to test servers, both producers and consumers are created without error, however:
I don’t see any video, the video element has a eternal spinning wheel.
The video stream is active but muted (muted: true).
producerScore is 0 but consumer score is 10.
I played with listenIps when creating WebRTC transport with those two values:
{ ip: ‘0.0.0.0’, announcedIp: 127.0.0.1 }
{ ip: ‘0.0.0.0’, announcedIp: [public IP of server] }
Make sure you have enabled the TCP/UDP ports which you provided to mediasoup’s createWorker method. Even if you have provided the right public ip of the server if your ports are not open then there will be no flow of data and hence paused tracks.
Exactly, it was a firewall problem. The rtc min to max ports declared in the worker (rtcMinPort and rtcMaxPort parameters) were not exposed in my server. I made a firewall rule to allow them (ex.: 40000:41999) and it worked.
You need to provide range of ports on which mediasoup will work while creating mediasoup worker, and you must open these tcp/udp ports for public on server so that traffic can move through them, otherwise it will not work. In the new versions of mediasoup you can provide single port instead of port range and in that case you will still have to open that single port for public to make it work.
If you are testing on local machine then set ip to 127.0.0.1 and keep the announcedIp empty. If you are on server then you need to set announcedIp to the public ip of the server.