RTCIceTransport: gatheringState property

The gatheringState read-only property of the RTCIceTransport interface returns a string that indicates the current gathering state of the ICE agent for this transport: "new", "gathering", or "complete".

You can detect when the value of this property changes by watching for an event of type gatheringstatechange.

Note that gatheringState represents the gathering state of just this transport, while RTCPeerConnection.iceGatheringState represents the overall gathering state of the whole connection, including every RTCIceTransport used by every RTCRtpSender and every RTCRtpReceiver on the entire connection.


A string that indicates the current state of the ICE agent's candidate gathering process:


The RTCIceTransport is newly created and has not yet started to gather ICE candidates.


The transport is in the process of gathering candidates.


The transport has finished gathering ICE candidates and has sent the end-of-candidates indicator to the remote device. The transport won't gather any further candidates unless an ICE restart occurs, at which point the gathering process starts over from scratch.


WebRTC: Real-Time Communication in Browsers
# dom-icetransport-gatheringstate

Browser compatibility

BCD tables only load in the browser