RTCIceCandidate:tcpType 属性
Baseline 2024Newly available
Since May 2024, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
RTCIceCandidate
接口的 tcpType
只读属性是 TCP 候选者所包含的,表示候选者的额外类型信息。
tcpType
字段的值是从传递给 RTCIceCandidate()
构造函数的 candidateInfo
选项对象中设置的。你不能直接在选项对象中指定 tcpType
的值,如果对象的 candidate
属性行(a-line)格式正确,其值将自动从对象的候选属性行中提取。
值
示例
本例中,使用候选者的 protocol
和 tcpType
属性来判断 TCP 候选者用户端是否同时打开(simultaneous-open)。
js
if (candidate.protocol === "tcp" && candidate.tcpType === "so") {
adjustForSimultaneousOpen(candidate);
}
规范
Specification |
---|
WebRTC: Real-Time Communication in Browsers # dom-rtcicecandidate-tcptype |