Kenneth
Kenneth

Reputation: 241

WebRTC occasionally gives black screen

I am creating a multi user video chat using webRTC. But i have encountered a problem with RTCPeerConnection

On some occasions i have chats with 7 users where everyone sees the other peoples videos but sometimes i get black screen from a user.

Weird thing is that it is totally random, sometimes everything works. sometimes a user has a black screen. if that user would re log there would be other screens black or everything would work.

I have checked my flow of how peerconnection works and here is how it works for me:

The user that starts the peerconnection:

The user that receives an offer and then creates answer:

I have also checked out chrome://webrtc-internals/ where i can see that for that specific black screen peerconnection the stream is there but it isn't sending any data trough it.

Anyone has an idea why sometimes the stream doesn't open here?

Upvotes: 11

Views: 2374

Answers (1)

Kenneth
Kenneth

Reputation: 241

Fixed this by adding multiple STUN server instead of relying on just one. I have seen that with using one google STUN server occasionally the requests do not return in time which makes webrtc stop searching for a path to send over the media streams.

I have added STUN servers from other open source suppliers

Upvotes: 1

Related Questions