Flaky ICE failing

Hello there!

I faced a strange flaky problem with ICE failing.

I put my Janus instance inside docker container. I set such NAT parameters in the config file:

stun_server = "stun.l.google.com"
stun_port = 19302

I also use iseServers variable in my application:

const iceServers = [{urls: "stun:stun.l.google.com:19302"}]

I use “videoroom” and “audiobridge” plugins in my app.

Scenario 1: Docker container is running on my local machine – everything works fine.

Scenario 2: Docker container is running on remote web server – here some troubles start.
The first user joins the room, “Turn on video” clicked → successfully publishes a video, “Turn on audio” –> successfully publishes audio – everything seems good.

The 2n user joins the room, appears in the publishers list, successfully subscribes to the mixed audio (gets “remote track added” and “remote track unmuted” events for audio), successfully subscribes to the 1st publisher videos (gets “remote track added” and “remote track unmuted” events for video).

Then ICE failed for component 1 in stream 1... appears in Janus logs and the 2nd user gets 2 events: “remote track muted” and “remote track ended” for video. So the 2nd user is not receiving the video from the first one but receiving the mixed audio.

The most strange here is that SOMETIMES scenario 2 works fine and the second user successfully starts receiving the video from the first one.

I don’t really know why it works like that. As far as I know all ICE problems are related to the inability of peers to find each other. But then why audio is working and video is not?

Thanks!

You can refer to this presentation for more info on WebRTC usage in docker: