The read-only property RTCPeerConnection.iceGatheringState
returns a string that describes the connection's ICE gathering state. This lets you detect, for example, when collection of ICE candidates has finished.
You can detect when the value of this property changes by watching for an event of type icegatheringstatechange
.