RTCIceCandidatePair - Web APIs 编辑
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.
Properties
local
- An
RTCIceCandidate
describing the configuration of the local end of the connection. remote
- The
RTCIceCandidate
describing the configuration of the remote end of the connection.
Example
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();
}
Specifications
Specification | Status | Comment |
---|---|---|
WebRTC 1.0: Real-time Communication Between Browsers The definition of 'RTCIceCandidatePair' in that specification. | Candidate Recommendation | Initial specification. |
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论