RTCIceCandidate
方法
toJSON()
converts the
RTCIceCandidate
on which it's called into JSON in the form of an
RTCIceCandidateInit
对象。
json = rtcIceCandidate.toJSON();
An object conforming to the
RTCIceCandidateInit
dictionary, whose members' values are set to the corresponding values in the
RTCIceCandidate
对象。
You can then get a stringified version of the object by calling
stringify()
on the returned object. See the
范例
下文。
This simple example obtains a JSON string representing an
RTCIceCandidate
found in the variable
candidate
.
var jsonString = candidate.toJSON().stringify();
| 规范 | 状态 | 注释 |
|---|---|---|
|
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCIceCandidate.toJSON()' in that specification. |
候选推荐 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
toJSON
|
Chrome 45 | Edge 15 | Firefox 27 | IE 不支持 No | Opera 32 | Safari Yes | WebView Android 45 | Chrome Android 45 | Firefox Android 27 | Opera Android 32 | Safari iOS Yes | Samsung Internet Android 5.0 |
完整支持
不支持
RTCIceCandidate
toJSON()
MediaDevices.getUserMedia()
Navigator.mediaDevices
RTCCertificate
RTCDTMFSender
RTCDTMFToneChangeEvent
RTCDataChannel
RTCDataChannelEvent
RTCDtlsTransport
RTCErrorEvent
RTCIceTransport
RTCPeerConnection
RTCPeerConnectionIceErrorEvent
RTCPeerConnectionIceEvent
RTCRtpReceiver
RTCRtpSender
RTCRtpTransceiver
RTCSctpTransport
RTCSessionDescription
RTCStatsEvent
RTCStatsReport
RTCTrackEvent