RTCPeerConnection: sự kiện icecandidate
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since September 2017.
Sự kiện icecandidate của giao diện RTCPeerConnection được gửi để yêu cầu candidate được chỉ định được truyền tới máy ngang hàng từ xa.
Cú pháp
js
addEventListener("icecandidate", (event) => { })
onicecandidate = (event) => { }
Loại sự kiện
Ví dụ
js
pc.onicecandidate = (event) => {
if (event.candidate) {
sendCandidateToPeer(event.candidate);
}
};
Thông số kỹ thuật
| Specification |
|---|
| WebRTC: Real-Time Communication in Browsers> # dom-rtcpeerconnection-onicecandidate> |