RTCIceCandidate interface's read-only foundation property is a string which uniquely identifies the candidate across multiple transports. As such, the foundation can be used to correlate candidates that are present on multiple RTCIceTransport 对象

句法

var foundation = RTCIceCandidate.foundation;
					

A DOMString which uniquely identifies the candidate across all RTCIceTransport s on which it is available.

注意: port is null — and port is supported by the 用户代理 — passing the candidate to addIceCandidate() will fail, throwing an OperationError 异常。

用法注意事项

Consider this SDP attribute line (a-line) which  describes an ICE candidate:

a=candidate:4234997325 1 udp 2043278322 192.168.0.56 44323 typ host
					

The field "4234997325" is the foundation.

范例

This code snippet uses the foundation of two candidates to determine if they're actually the same candidate.

if (candidate1.foundation == candidate2.foundation) {
  /* the two candidates are the same, even if they're on
     different transports */
}
					

规范

规范 状态 注释
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCIceCandidate.foundation' in that specification.
候选推荐 初始定义。

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
foundation Chrome 74 Edge ≤18 Firefox 不支持 No IE 不支持 No Opera 不支持 No Safari ? WebView Android 74 Chrome Android 74 Firefox Android ? Opera Android 不支持 No Safari iOS ? Samsung Internet Android 11.0

图例

完整支持

完整支持

不支持

不支持

兼容性未知 ?

兼容性未知

元数据

  • 最后修改: