RTCIceCandidate
()
constructor creates and returns a new
RTCIceCandidate
object, which can be configured to represent a single
ICE
candidate.
candidate = new RTCIceCandidate([candidateInfo]);
candidateInfo
可选
RTCIceCandidateInit
object providing information about the candidate; if this is provided, the candidate is initialized configured to represent the described candidate.
A newly-created
RTCIceCandidate
object, optionally configured based on the specified object based on the
RTCIceCandidateInit
字典。
若
candidateInfo
is provided, the new
RTCIceCandidate
is initialized as follows:
RTCIceCandidateInit
object is initialized to the value of the property by the same name from
RTCIceCandidateInit
. This includes the
candidate
,
sdpMid
,
sdpMLineIndex
,和
usernameFragment
特性。
candidate
string (which is SDP text) is parsed; each property found is stored in the corresponding field in the
RTCIceCandidate
. If any of the fields is invalid, parsing of the string silently aborts without throwing an exception. The default value of
candidate
is the empty string, which indicates that the candidate is an "end-of-candidates" message.
null
if they are not included in the
RTCIceCandidate.candidate
特性:
foundation
,
component
,
priority
,
ip
,
协议
,
port
,
type
,
tcpType
,
relatedAddress
,和
relatedPort
.
注意:
Parsing of the
candidate
string is performed using the
candidate-attribute grammar
from the WebRTC Specification.
TypeError
RTCIceCandidateInit
has values of
null
in both the
sdpMid
and
sdpMLineIndex
特性。
This constructor does not do complete validation of the specified
candidateInfo
object or string.
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCIceCandidate()' in that specification. |
候选推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
RTCIceCandidate()
构造函数
|
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 |
完整支持
不支持
兼容性未知
见实现注意事项。
RTCIceCandidate
RTCIceCandidate()
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannel
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceTransport
RTCPeerConnection
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent