Intent to Implement and Ship: RTCPeerConnection icegatheringstatechange event

52 views
Skip to first unread message

Philipp Hancke

unread,
Mar 3, 2017, 1:11:07 PM3/3/17
to blin...@chromium.org

Contact emails

philipp...@googlemail.com, h...@chromium.org


Spec

http://w3c.github.io/webrtc-pc/#event-icegatheringstatechange

added in June 2014.


I suppose the TAG should have reviewed that as part of the review of 1.0 but I can't find any response to https://lists.w3.org/Archives/Public/www-tag/2016Feb/0000.html


Summary

The change adds an event named icegatheringstatechange to the RTCPeerConnection API.

It is used like this:

var pc = new RTCPeerConnection();

pc.addEventListener('icegatheringstatechange', function() {

console.log("gathering", pc.iceGatheringState);

})

pc.createOffer({offerToReceiveAudio: 1})

.then((offer) => pc.setLocalDescription(offer));



Motivation

This event is somewhat similar to the icecandidate event with the null candidate. In fact, that event has always been implement on top of the webrtc.org native icegatheringstatechange event, see

https://codesearch.chromium.org/chromium/src/content/renderer/media/rtc_peer_connection_handler.cc?dr&l=1792


This has lead to developers writing code for the icecandidate event that looks as follows:

pc.onicecandidate = function(e) {

  if (e.candidate) {

    // signal candidate

  } else {

    // we are done gathering and if we don't think ICE tastes better when it trickles (https://webrtchacks.com/trickle-ice/)

    // we can grab the localDescription containing all ice candidates now and send it to the other side.

  }

}

Ideally developers will stop doing accessing the localDescription in onicecandidate and do it in the icegatheringstatechange event.


Interoperability and Compatibility Risk

Firefox fixed this (as a bugfix) in Firefox 53: https://bugzilla.mozilla.org/show_bug.cgi?id=1193731

Microsofts WebRTC "1.0" implementation supports it as well as the adapter.js shim of RTCPeerConnection ontop of ORTC.


Ongoing technical constraints

None


Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes.


OWP launch tracking bug

N/A


https://bugs.chromium.org/p/chromium/issues/detail?id=681083 is tracking the bug.


Link to entry on the feature dashboard

N/A


Requesting approval to ship?

Yes.

TAMURA, Kent

unread,
Mar 6, 2017, 11:11:06 PM3/6/17
to Philipp Hancke, blink-dev
LGTM1.
Please make a chromestatus.com entry.

--
TAMURA Kent
Software Engineer, Google


Chris Harrelson

unread,
Mar 6, 2017, 11:50:23 PM3/6/17
to TAMURA, Kent, Philipp Hancke, blink-dev
LGTM2

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Dimitri Glazkov

unread,
Mar 7, 2017, 10:21:06 AM3/7/17
to Chris Harrelson, TAMURA, Kent, Philipp Hancke, blink-dev
LGTM3

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

Henrik Boström

unread,
Mar 8, 2017, 5:04:34 AM3/8/17
to blink-dev, chri...@chromium.org, tk...@chromium.org, philipp...@googlemail.com
LGTM3

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
Reply all
Reply to author
Forward
0 new messages