W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > April 2019

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

From: Jan-Ivar Bruaroey via GitHub <sysbot+gh@w3.org>
Date: Sun, 07 Apr 2019 23:42:44 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issues.opened-430206785-1554680563-sysbot+gh@w3.org>
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

This archive was generated by hypermail 2.3.1 : Tuesday, 4 June 2019 15:32:56 UTC