WebRTC API's
RTCIceCandidateInit
dictionary, which contains the information needed to fundamentally describe an
RTCIceCandidate
.
RTCIceCandidateInit
is used when using
new RTCIceCandidate()
to create a new ICE candidate object. It's also used as the return value from the
RTCIceCandidate.toJSON()
method, and can be passed directly into
RTCPeerConnection.addIceCandidate()
to add a candidate to the peer connection.
candidate
可选
candidate-attribute
. If the candidate is an indicator that there are no further candidates (rather than representing a new candidate), this is the empty string (
""
). The default is the empty string.
sdpMid
可选
null
if there is no associated media stream. The default is
null
.
sdpMLineIndex
可选
null
if no such associated exists. The default is
null
.
usernameFragment
可选
DOMString
containing a string which uniquely identifies the remote peer. This string is generated by WebRTC at the beginning of the session, and at least 24 bits worth of the string contain random data. The string may be up to 256 characters long. This property has no default value and is not present unless set explicitly.
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCIceCandidateInit' in that specification. |
候选推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
RTCIceCandidateInit
|
Chrome Yes | Edge ≤18 | Firefox 22 | IE 不支持 No | Opera Yes | Safari ? | WebView Android Yes | Chrome Android Yes | Firefox Android Yes | Opera Android Yes | Safari iOS ? | Samsung Internet Android Yes |
candidate
|
Chrome Yes | Edge ≤18 |
Firefox
22
注意事项
|
IE 不支持 No | Opera Yes | Safari ? | WebView Android Yes | Chrome Android Yes |
Firefox Android
Yes
注意事项
|
Opera Android Yes | Safari iOS ? | Samsung Internet Android Yes |
sdpMid
|
Chrome Yes | Edge ≤18 | Firefox 22 | IE 不支持 No | Opera Yes | Safari ? | WebView Android Yes | Chrome Android Yes | Firefox Android Yes | Opera Android Yes | Safari iOS ? | Samsung Internet Android Yes |
sdpMLineIndex
|
Chrome Yes | Edge ≤18 | Firefox 22 | IE 不支持 No | Opera Yes | Safari ? | WebView Android Yes | Chrome Android Yes | Firefox Android Yes | Opera Android Yes | Safari iOS ? | Samsung Internet Android Yes |
usernameFragment
|
Chrome Yes | Edge ≤18 | Firefox 67 | IE 不支持 No | Opera Yes | Safari ? | WebView Android Yes | Chrome Android Yes | Firefox Android 67 | Opera Android Yes | Safari iOS ? | Samsung Internet Android Yes |
完整支持
不支持
兼容性未知
见实现注意事项。
RTCIceCandidateInit
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannel
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceCandidate
RTCIceTransport
RTCPeerConnection
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent