video freeze when background http requests are running


We are using mediasoup client, which works with simulcast.
The video is working well, on top of a site (the site is in the background in a different iframe).
Whenever the site triggers http reuqests - i.e load some content in it’s iframe, the video freezes.
Trying to lower the resolution and bps doesn’t help.
I tried prioritizing the webrtc network with

await producer.setRtpEncodingParameters({ networkPriority: 'high' });

but it didn’t help and we still experience the freezes in the video.
Any idea how can tackle this problem?


This is completely ignored by Chrome. It’s a noop.

Subscribe to producer.on('score') event in server side, do producer.getStats() in client side, etc. No magic response :slight_smile:

Hi Iñaki,

Thanks again for the fast response!!!
I didn’t mention that we mainly see this problem on mobile - iOS/Safari or Android/Chrome.
The question is whether there is an option to set priority for webRTC.
Can you please point us what should we investigate in the client/server stats?

Browsers in mobile stop everything (timers, WebSockets, etc) when going to background, much more in iOS. This is not about prioritizing WebRTC. BTW no way to prioritize it. That does not exist.

In server side producer.on('score'). Check the doc to see how to interpret the values.

It’s not going to background. We have the site in an iFrame, and a div with the video on top. Only the iframe content is loaded in the background and causing the video to to freeze.
I will check the stat on the producer, though, not sure what I can find there…

I insist on the producer score event in server side. Other than that I don’t know how the browser behaves in mobile with iframes.