W3C home > Mailing lists > Public > public-webrtc@w3.org > November 2015

I made PR 407, to make the ICE candidate object an interface

From: Taylor Brandstetter <deadbeef@google.com>
Date: Mon, 30 Nov 2015 10:57:57 -0800
Message-ID: <CAK35n0b-Ztteoj63dsNSYejPWiBe9CM5Hdg36icowWExySDBbw@mail.gmail.com>
To: public-webrtc@w3.org
Harald and Adam pointed out that RTCIceCandidate needs to be an interface,
not a dictionary, since it's an attribute of RTCPeerConnectionIceEvent.

So, here's a new PR that returns to the "interface with an init dictionary"
pattern: https://github.com/w3c/webrtc-pc/pull/407

A summary of the PR:

   - addIceCandidate now takes a union type of the interface and the init
   dictionary. So legacy code that does "addIceCandidate(new
   RTCIceCandidate({...}));" and new code that does "addIceCandidate({...});"
   should both work.
   - Defined "RTCIceCandidateInit" (like we had before) which contains only
   the candidate, sdpMid and sdpMLineIndex members.
   - RTCIceCandidate becomes an interface, with a constructor that takes an
   RTCIceCandidateInit. This is partly for legacy backwards compatibility, but
   it also lets an application construct an RTCIceCandidate and then inspect
   the new attributes populated.
   - All the members of RTCIceCandidate become readonly attributes. Some of
   them are nullable.

Also, a side-note: I noticed that somewhere along the way, the dictionary
argument of the RTCIceCandidate constructor went from optional to required.
So any code doing the following will no longer work:

var candidate = new RTCIceCandidate();
candidate.candidate = /*...*/;
candidate.sdpMLineIndex = /*...*/;

Is this ok?
Received on Monday, 30 November 2015 18:58:36 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:47 UTC