Sometimes the publisher camera does not play video

The issue is when a publisher attempt to join a room. For example if I have 2 users in one room, and then another one join, sometimes the other 2 users can not see the webcam of the 3th user. Sometimes happens backward, like the 3th user does not see one of the other 2 users.

Image: openvidu/openvidu-server-kms:2.16.0
Tutorial: openvidu-js-node
I have my own STUN/TURN server on an AWS instance.

Time Component Type Foundation Protocol Address Port Priority
0.004 rtp host 562955089 udp 6fbe89fe-0630-4b3c-baa5-85de3bdfe80d.local 63766 126 | 30 | 255
0.197 rtp srflx 842163049 udp 201.239.88.83 31817 100 | 30 | 255
0.197 Done
0.198

(If I refresh the page and attempt to reconnect on the same room, sometimes it works, but sometimes I need to join the room 2-3 times to see all the publisher webcams)

I’m not sure how to debug this, on the chrome console there are no errors.

After researching a little bit I found this:
OpenViduLogger.ts:37 IceConnectionState of RTCPeerConnection ae0222b2-9ae9-43ec-85a9-dc4aec0bf389 (str_CAM_HJyk_con_HQRlRioSVV) change to "disconnected". Possible network disconnection
Not sure what is wrong

This is the console log for the image example:

'OpenVidu' initialized
OpenViduLogger.ts:31 openvidu-browser version: 2.16.0
OpenViduLogger.ts:31 openvidu-server version: 2.16.0
OpenViduLogger.ts:31 'Connection' created (local)
OpenViduLogger.ts:31 Remote 'Connection' with 'connectionId' [con_Q9DptDjOg4] is now configured for receiving Streams with options:  {id: "str_CAM_RD9Q_con_Q9DptDjOg4", createdAt: 1610457162461, connection: Connection, hasAudio: true, hasVideo: true, …}
OpenViduLogger.ts:31 'Connection' created (remote) with 'connectionId' [con_Q9DptDjOg4]
OpenViduLogger.ts:31 Event 'streamCreated' triggered by 'Session' StreamEvent {hasBeenPrevented: false, cancelable: false, target: Session, type: "streamCreated", stream: Stream, …}
OpenViduLogger.ts:31 Subscribing to con_Q9DptDjOg4
OpenViduLogger.ts:31 Event 'videoElementCreated' triggered by 'Subscriber' VideoElementEvent {hasBeenPrevented: false, cancelable: false, target: Subscriber, type: "videoElementCreated", element: video#remote-video-str_CAM_RD9Q_con_Q9DptDjOg4}
OpenViduLogger.ts:31 'Subscriber' (str_CAM_RD9Q_con_Q9DptDjOg4) successfully subscribed
OpenViduLogger.ts:31 Subscribed correctly to con_Q9DptDjOg4
OpenViduLogger.ts:19 IceConnectionState of RTCPeerConnection 5ba11668-5633-4829-8a6b-d1b0fa9b2013 (str_CAM_RD9Q_con_Q9DptDjOg4) change to "checking"
OpenViduLogger.ts:19 IceConnectionState of RTCPeerConnection 5ba11668-5633-4829-8a6b-d1b0fa9b2013 (str_CAM_RD9Q_con_Q9DptDjOg4) change to "connected"
OpenViduLogger.ts:31 Event 'videoElementCreated' triggered by 'Publisher' VideoElementEvent {hasBeenPrevented: false, cancelable: false, target: Publisher, type: "videoElementCreated", element: video#local-video-undefined}
OpenViduLogger.ts:31 'Publisher' (str_CAM_DgMS_con_RQDeUm6fUu) successfully published to session
OpenViduLogger.ts:19 IceConnectionState of RTCPeerConnection 970e37f3-7475-489f-91bd-c1d893b2cabe (publisher of con_RQDeUm6fUu) change to "checking"
OpenViduLogger.ts:19 IceConnectionState of RTCPeerConnection 970e37f3-7475-489f-91bd-c1d893b2cabe (publisher of con_RQDeUm6fUu) change to "connected"
OpenViduLogger.ts:31 Your local 'Stream' with id [str_CAM_DgMS_con_RQDeUm6fUu] video is now playing
OpenViduLogger.ts:31 Remote 'Stream' with id [str_CAM_RD9Q_con_Q9DptDjOg4] video is now playing
OpenViduLogger.ts:31 'Connection' created (remote) with 'connectionId' [con_UBny0RxFP5]
OpenViduLogger.ts:31 'Connection' created (remote) with 'connectionId' [con_IKReUrE9po]
OpenViduLogger.ts:31 'Connection' created (remote) with 'connectionId' [con_JAblCi0RIW]
OpenViduLogger.ts:31 Remote 'Connection' with 'connectionId' [con_JAblCi0RIW] is now configured for receiving Streams with options:  {id: "str_CAM_PKnc_con_JAblCi0RIW", createdAt: 1610457538782, connection: Connection, hasAudio: true, hasVideo: true, …}
OpenViduLogger.ts:31 Event 'streamCreated' triggered by 'Session' StreamEvent {hasBeenPrevented: false, cancelable: false, target: Session, type: "streamCreated", stream: Stream, …}
OpenViduLogger.ts:31 Subscribing to con_JAblCi0RIW
OpenViduLogger.ts:31 Event 'videoElementCreated' triggered by 'Subscriber' VideoElementEvent {hasBeenPrevented: false, cancelable: false, target: Subscriber, type: "videoElementCreated", element: video#remote-video-str_CAM_PKnc_con_JAblCi0RIW}
OpenViduLogger.ts:31 'Subscriber' (str_CAM_PKnc_con_JAblCi0RIW) successfully subscribed
OpenViduLogger.ts:31 Subscribed correctly to con_JAblCi0RIW
OpenViduLogger.ts:19 IceConnectionState of RTCPeerConnection 2ff65195-a27d-408f-a990-0db7401707fd (str_CAM_PKnc_con_JAblCi0RIW) change to "checking"
OpenViduLogger.ts:19 IceConnectionState of RTCPeerConnection 2ff65195-a27d-408f-a990-0db7401707fd (str_CAM_PKnc_con_JAblCi0RIW) change to "connected"

Hi. openvidu/openvidu-server-kms:2.16.0 image is only suitable for development environments. It is only recommended for local networks. If you try connecting clients from different networks using this image, it is possible they fail to connect.

To deploy OpenVidu follow the AWS or On Premises deployment instructions: OpenVidu Docs

@pabloFuente Thank you so much for your answer. I understand that this should work in a local networks, that is why I set up the “DOMAIN_OR_PUBLIC_IP” to my local ip address and I’m doing test with another computers in the same network. So you said that this also could have issues?

Yes, in regular local networks this image works fine. If there are any kind of special rules inside the network, or maybe subnets restricting ports or local IPs, that could be a problem. But in common local networks it works just fine.

@pabloFuente Got it, Ok so I did a deploy in a AWS server, and now everything is working fine. Sometimes one camera does not work, but at least is more stable now. Do you have any recommendation why sometime it fail?, I need to refresh and re connect to see the camera, that is the issue.