The 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.transport; 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(); }
Specification | Status | Comment |
---|---|---|
WebRTC 1.0: Real-time Communication Between Browsers The definition of 'RTCIceCandidatePair' in that specification. | Candidate Recommendation | Initial specification. |
No compatibility data found. Please contribute data for "api.RTCIceCandidatePair" (depth: 1) to the MDN compatibility data repository.
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidatePair