Could not display for remote producers


Hi,
I’m trying to implement follow the mediasoup demo. Everything looks good, but when I test on 2 peers, I could not get the video on the second peer. The first one does screen sharing, and the video can bind to the local video srcObject as well, but something is wrong with the second peer.

You will have to see chrome://webrtc-internals to debug the peer connections, or share screenshot here.

There can be many reasons for this type of issue, like not using proper public ip address on server after deployment or if you are testing on local then something like not resuming consumer after consuming the transport or simply not rendering the streams properly etc. You can console log the track received to see whether it is paused or not.

Thanks for your reply,
I use the same server for my client and mediasoup-demo client, the mediasoup-demo client is working well with my server so i think it’s not related to server’s public ip.
I also try “pause: true” when consumerTransport consume on the server and then resume when connectionstatechange to connected, but it still work well with mediasoup-demo, not with my client code. My client code still receives the consumer track, but could not render it. When I log the consumer track, it seems the same result as when I log on mediasoup-demo.
I implement mediasoup-client on nextjs framework, so I’m wondering that is there any diff with implementing mediasoup-client in the demo?
Let me know if you have any ideas, thank u!

Nextjs will not make any difference, at the end it is going to be javascript. First thing you need to do is to check the things with the peer connection that will tell you all the story, go to chrome://webrtc-internals and it will show you all the details about all peer connections (transports) you have opened.

Share the screenshot here, I will be able to tell you then.

Server 192.168.3.101
Client: 192.168.3.102
2 Peers run on the same client, Peer 1 does screen sharing

For stats graphs detail

Everything is normal, data is being sent and received properly. The only issue that can be imagined based upon this is that you are not displaying the video properly، to make sure about that kindly enable controls on video player and play it manually may be there is some autoplay issue, also console log the srcObject for video element

You are right, it seems the root cause of this issue is related to video player.
Thank you for your support!

You were able to play the video manually hi hitting the play button?

Yes, play manually is OK, but autoPlay not working.

I found a solution on StackOverflow by, adding autoplay along with muted. It worked for me.

Great check out my recent topic to enable audio autoplay on ios:

Thank you so much!