RTCPeerConnectionIceEvent.candidate

candidateRTCPeerConnectionIceEvent インターフェイスの読み取り専用のプロパティで、そのイベントに関連付けられた RTCIceCandidate (en-US) を返します。

受信した ICE の候補を表す RTCIceCandidate (en-US) オブジェクト、 またはこのネゴシエーションセッションの候補がないことを表す null です。

js
pc.onicecandidate = (ev) => {
  alert(
    `The ICE candidate (transport address: '${ev.candidate.candidate}') has been added to this connection.`,
  );
};

仕様書

Specification
WebRTC: Real-Time Communication in Browsers
# dom-rtcpeerconnectioniceevent-candidate

ブラウザーの互換性

BCD tables only load in the browser

関連情報