Firefox is not showing video from Consumer, track is always muted

Hello everyone!
mediasoup is awesome, thank you for this project and such a warm support.

I encountered a mindblowing problem with Firefox 114.0.2 (64-bit) on Mac OS 13.4.1 (22F82) - Firefox does not play video track received from the server.
Everything is OK in Google Chrome, Opera, Safari, but Firefox stuck somewhere…

Here is the part of the code that I wrote to bypass Firefox bug… seems stupid, but don’t know how to make it work in single and common flow:

Any suggestions why this happens and how can it be fixed?

Solution

Indeed, changing announcedIp to 192.168.0.102 (my local real ip) and leaving ip 0.0.0.0 worked great in Firefox and also works in any other browser.

To get real local ip on Mac OS: ipconfig getifaddr en0

Related issue that helped me: Firefox: ICE failed, add a STUN server and see about:webrtc for more details - #6 by ibc

Forgot to mention that I am using paused:true and I am correctly resuming on client-server sides. Other browsers do not show any errors - video is playing as expected.

What is stream that is assigned to videoStream?

const stream = await navigator.mediaDevices.getUserMedia({video: true}),
videoTrack = stream.getVideoTracks()[0],
producer = await sendTransport.produce({
                                    track: videoTrack,
                                    encodings: [
                                        {maxBitrate: 100000},
                                        {maxBitrate: 300000},
                                        {maxBitrate: 900000}
                                    ],
                                    codecOptions: {
                                        videoGoogleStartBitrate: 1000,
                                    }
                                })

Well, and what of this is a workaround?

A workaround is about replacing remote stream with a local one. But that’s a stupid solution :slight_smile:
Why Firefox is not displaying video… no idea :frowning:

Is autoplay policy satisfied? It may slightly vary in different browsers.

Tried everything - with and without confirm() dialog / popup dialogs, etc… the same problem all the time.

And what does about:webrtc show? Is the stream received?

Can you help me with this? Don’t know where to look for…

Got this warning… complaining in Firefox60.js

Looks like it didn’t even try to connect. Are you using proxy by chance? I remember someone experienced a problem that looked similar: Firefox doesn't work sometimes until the consumer side run getUserMedia or getDisplayMedia

As to the warning, it is ok: Firefox warning "Invalid setParameters call detected"

1 Like

Nope, I am not using proxy - I am working on my localhost

Thanks, I’ll try requesting user media before playing track, but it looks like a shitty solution for a simple viewer (consumer).

What address you using? Firefox is known for not offering any loopback ICE candidates, unless media.peerconnection.ice.loopback option is set to true. I would advise to use the address of some real local interface as announcedIp (i.e. not 127.0.0.1, but 192.168.x.x or whatever you have).

I am using 127.0.0.1
Will try something like 192.168.0.XXX
Thanks!

It does work in Firefox when I set media.peerconnection.ice.loopback to true, but fails with any other IP address - 192.168.X.X with turned media.peerconnection.ice.loopback off.