fireship-io / webrtc-firebase-demo

Video Chat with WebRTC and Firebase
533 stars 321 forks source link

Current code only works when both users are on the same device #21

Open Fritswp opened 8 months ago

Fritswp commented 8 months ago

Hi, the current code seems to work only when both users are on the same device.

For example using localhost and the ip adress on the same device shows both screens whereas using two devices in a local environment only shows the local streams

williamdaugherty commented 4 months ago

Hello, try setting up TURN servers in addition to STUN servers.

sostenesapollo commented 1 week ago

@williamdaugherty how can we do that ?

williamdaugherty commented 1 week ago

@sostenesapollo const servers = { iceServers: [ { urls: ['stun:stun1.l.google.com:19302', 'stun:stun2.l.google.com:19302'], }, { urls: 'turn:YOUR_TURN_SERVER_URL', // Replace with your TURN server URL username: 'YOUR_USERNAME', // Replace with your TURN server username credential: 'YOUR_CREDENTIAL', // Replace with your TURN server password }, ], iceCandidatePoolSize: 10, };