React-native-webrtc: Video Become Black if using mobile data plan

Created on 1 May 2020  路  6Comments  路  Source: react-native-webrtc/react-native-webrtc

Hi everyone, I just faced an issue on when trying to connect between the devices, if I using the same network with WIFI it running well all devices that connected can see each device that connected,
but if I change the network like using Mobile Data Plan, and the others using wifi, the one that using Mobile Data Plan just showing a black screen for a video that streamed and also in another device, it will show a black screen

the case:

1

DEVICE 1 : USING WIFI (Same Networks)
DEVICE 2 : USING WIFI (Same Networks)
DEVICE 3 : USING WIFI (Same Networks)
this will be running well

2

DEVICE 1 : USING WIFI
DEVICE 2 : MOBILE DATA PLAN
DEVICE 3 : MOBILE DATA PLAN
2,3 device will show a black screen

this show that showing running perfectly because use the same networks and WIFI
https://aws1.discourse-cdn.com/free1/uploads/reactnativewebrtc1/original/1X/926dad627a777ec733466d1834c630ffc2c57e98.jpeg

this is pict that showing a black screen, at the bottom left, it should show video stream from another peer
https://aws1.discourse-cdn.com/free1/uploads/reactnativewebrtc1/original/1X/2aaee1ada045cb3547a2d222436bced0e57a0f19.jpeg

the getting offer and sending answer was logged same,

what things can be caused this issue? is that because of the signaling server? or ISP ? or firewall? or just my code? still cannot get the real issue of this.

Thanks a lot

Most helpful comment

hi @bcgoodmate i just fixed this issues with changing our STUN and TURN server, you can try this public server

  webex_config: {
    iceServers: [
      {urls: 'stun:stun.l.google.com:19302'},
      {
        url: 'turn:numb.viagenie.ca',
        credential: 'muazkh',
        username: '[email protected]',
      },
    ],
  },

only for testing and development purpose to make sure that's the problem was on you stun/turn server

All 6 comments

Rough guess.... youre not using a TURN server? Check out your ice candidates

But this isn't a code issue - check out https://react-native-webrtc.discourse.group/ for support

hi @danjenkins iam using my own turn and stun server sir, ice candidates were sending each other, did you what is a possible issue in here? in the forum there is no one answer it

It seems that WEBRTC peer connection only works if both devices are connected on the same network. How can we resolve this problem?

hi @bcgoodmate i just fixed this issues with changing our STUN and TURN server, you can try this public server

  webex_config: {
    iceServers: [
      {urls: 'stun:stun.l.google.com:19302'},
      {
        url: 'turn:numb.viagenie.ca',
        credential: 'muazkh',
        username: '[email protected]',
      },
    ],
  },

only for testing and development purpose to make sure that's the problem was on you stun/turn server

It definitely worked! Thank you so much for this sample STUN/TURN configuration.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cristiantx picture cristiantx  路  5Comments

szymonzmyslony picture szymonzmyslony  路  7Comments

ibc picture ibc  路  3Comments

benoitc picture benoitc  路  5Comments

tommynordli picture tommynordli  路  4Comments