I have exhausted all possibilities to get a stable WebRTC implementation working and am looking to get some advice.
All possible solutions to handling a working connecti
I found this function useful in your situation :)
function waitForAllICE(pc) {
return new Promise((fufill, reject) => {
pc.onicecandidate = (iceEvent) => {
if (iceEvent.candidate === null) fufill()
}
setTimeout(() => reject("Waited a long time for ice candidates..."), 10000)
})
}
You can then do, for something along the lines of
pc.createOffer()
.then(offer => pc.setLocalDescription(offer))
.then( () => waitForAllICE(pc))
.then( () => signallingWire.send(pc.localDescription))
.catch( e => smartErrorHandling(e))