Share via


onlocalcandidate event

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

Fires when a new local ICE candidate is available. It must be supported by all objects implementing the RTCIceGatherer interface. Since ICE gathering begins once an RTCIceGatherer object is created, candidate events are queued until an onlocalcandidate event handler is assigned. When the final candidate is gathered, a candidate event occurs with an RTCIceCandidateComplete emitted.

Syntax

Event Property object.onlocalcandidate = handler;
attachEvent Method object.attachEvent("onlocalcandidate", handler)

 

Event handler parameters

  • RTCIceGatherer Event
    Type: icecandidate

    The state attribute is the new RTCIceGathererState that caused the event to fire.

  • RTCIceCandidateComplete
    Type: boolean

    Indicates that ICE candidate gathering is complete. This attribute is always present and has a default setting of true.

  • RTCIceCandidate
    Type: RTCIceGathererCandidate

    Information relating to an ICE candidate.

Standards information

EXAMPLES

iceGatherer.onlocalcandidate = function (event) {
    mySendLocalCandidate(event.candidate);
}; 

iceRtcpGatherer.onlocalcandidate = function (event) {
  mySendLocalCandidate(event.candidate, RTCIceComponent.RTCP);
}; 

See also

RTCIceGatherer