Hello,
How does one go about resetting the state of WebRTC components in Chrome -- without reloading the page -- when they're kicked into an invalid state? See below for more details about how I'm replicating this state, and why I'm asking this:
I'm getting the following error in Chrome when trying to set Ice Candidates when making a call:
Failed to execute 'addIceCandidate' on 'RTCPeerConnection': The ICE candidate could not be added.
Now, I know why it's happening. I'm working on making a ROBUST WebRTC application that can handle some normal user abuse. To replicate this state, I basically have to make a couple WebRTC calls and then kill them real fast and then immediately try another call. I'm guessing this must kick the PeerConnection and other components into a different state where it's expecting B to happen, but I'm starting over again with A. This is evidenced by the following error message:
Failed to set session description: Failed to set remote answer sdp: Called in wrong state: STATE_INIT
Now, Most of the WebRTC demos we see on the Internet, like
http://apprtc.appspot.com are stateless, and the browser is refreshed often, which results in resetting the DOM state. So, for those developers, the answer is easy. Just reload the page and call it good.
However, since I'm building a single page application, not a website, I'm wondering if there is a way to make a call to the API to tell it to reset the state of whatever it is that is throwing these errors? Currently, I have to reload the application when the DOM enters this state.
Thank you for your assistance!
James