Problem: My webrtc works totally fine from localhost environment or in the same wifi, but it unfortunately fails over distinct networks. I have searched extensively about this subject across stackoverflow but none have provided me a working solution.
Platform: Android => Firefox or Chrome (Android creates offer)
I have tried: -Using stun:stun.l.google.com:19302 server -Using public turn servers -Hosting my own turn server through VPS and Coturn -Hosting my own stun server similarly -HAVE ALREADY VERIFIED my own stun/turn servers on https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice/. They all return correct sfrlx and relay ice candidates, respectively.
If I run it on chrome, the console does not raise any errors. If I run it on firefox, however, the console does fire : "ICE FAILED, see about:webrtc for more details"
And here is my about:webrtc log https://pastebin.com/jLHVFGxH
Some more tabular informations: https://i.stack.imgur.com/oInn0.png https://i.stack.imgur.com/FSGYx.png
My iceServer configuration:
var connection = new RTCPeerConnection({
iceServers: [{
urls:'stun:stun.l.google.com:19302'
},
{
url: 'turn:64.227.18.138:3478',
credential: '*****',
username: '******'
}]
})
Now on android side:
List<PeerConnection.IceServer> iceServers = new ArrayList<>();
iceServers.add(PeerConnection.IceServer.builder("stun:stun.l.google.com:19302").createIceServer());
iceServers.add(PeerConnection.IceServer.builder("turn:64.227.18.138:3478").setUsername("*****").setPassword("*******").createIceServer());