[webrtc-pc] ICE restart deserves a first-class API. (#2167)

jan-ivar has just created a new issue for https://github.com/w3c/webrtc-pc:

== ICE restart deserves a first-class API. ==
The currrent ICE restart API doesn't work well with `negotiationneeded`. Say you have this:
```js
pc.onnegotiationneeded = async () => {
  await pc.setLocalDescription(await pc.createOffer());
  io.send({desc: pc.localDescription});
}
```
How is the application supposed to restart ICE? Break that abstraction and call the methods directly, duplicating whatever logic the app may have put in there—after of course first checking we're in `"stable"` state and handling glare? That seems error-prone.

Performing an ICE restart is an application choice, often made for external network reasons. I think it deserves a first-class API that works with `negotiationneeded` and survives rollback:
```js
pc.restartIce();
```
This new method would set an internal slot that would cause negotiation to be needed, would invert the default value of the `{iceRestart}` offer option, and would be cleared in SRD(answer).

Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2167 using your GitHub account

Received on Sunday, 7 April 2019 23:42:45 UTC