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

Re: icecandidate event with no candidate

From: ᛏᚮᛘᛘᚤ <tommyw@google.com>
Date: Mon, 22 Apr 2013 16:26:02 +0200
Message-ID: <CALLKCfNvf7BSznMbcMw0HMnSFSv4piFLNQe3MNRNNzEXsbUYqw@mail.gmail.com>
To: Adam Bergkvist <adam.bergkvist@ericsson.com>
Cc: "public-webrtc@w3.org" <public-webrtc@w3.org>
Chromium sends the null icecandidate just because there isn't a
onicegatheringcomplete
event handler.

And as far as I understand it sometimes we don't know that a icecandidate
is the last one which makes your first suggestion unimplementable.



On Mon, Apr 22, 2013 at 2:43 PM, Adam Bergkvist <adam.bergkvist@ericsson.com
> wrote:

> Hi
>
> I got some offline feedback from a user of our API, regarding the way we
> signal that the gathering process is done. The comment was: "Why do I get
> an icecandidate event without a candidate? That's like a mouse-click-event
> that says that the mouse wasn't clicked."
>
> If we want to change this behavior, there are a bunch of alternatives.
> Here are two:
>
> One variant is to set the iceGatheringState to "complete" when the last
> candidate is emitted. This approach is a bit dependent on if the UA can
> figure out if this is the last candidate without delaying it (too much).
>
> pc.onicecandidate = function (evt) {
>     dealWithCandidate(evt.**candidate);
>     if (pc.iceGatheringState == "complete")
>         sendOfferOrAnswer();
> };
>
> An other option is to simply use separate events.
>
> // separate events
> pc.onicecandidate = function (evt) {
>     dealWithCandidate(evt.**candidate);
> };
>
> pc.onicegatheringcomplete = function () {
>     sendOfferOrAnswer();
> };
>
> /Adam
>
>
Received on Monday, 22 April 2013 14:26:33 UTC

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