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. |
候选推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 |
完整支持
不支持
兼容性未知
RTCIceCandidate
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannel
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceTransport
RTCPeerConnection
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent