RTCIceCandidatePair
dictionary describes a pair of ICE candidates which together comprise a description of a viable connection between two WebRTC endpoints.
It is used as the return value from
RTCIceTransport.getSelectedCandidatePair()
to identify the currently-selected candidate pair identified by the ICE agent.
local
RTCIceCandidate
describing the configuration of the local end of the connection.
remote
RTCIceCandidate
describing the configuration of the remote end of the connection.
In this example, an event handler for
selectedcandidatepairchange
is set up to update an on-screen display showing the protocol used by the currently selected candidate pair.
var iceTransport = pc.getSenders()[0].transport.iceTransport;
var localProto = document.getElementById("local-protocol");
var remoteProto = document.getElementById("remote-protocol");
iceTransport.onselectedcandidatepairchange = function(event) {
var pair = iceTransport.getSelectedCandidatePair();
localProtocol.innerText = pair.local.protocol.toUpperCase();
remoteProtocol.innerText = pair.remote.protocol.toUpperCase();
}
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCIceCandidatePair' in that specification. |
候选推荐 | 最初的规范。 |
No compatibility data found. Please contribute data for "api.RTCIceCandidatePair" (depth: 1) to the MDN 兼容性数据存储库 .
RTCIceCandidatePair
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannel
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceCandidate
RTCIceTransport
RTCPeerConnection
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent