RTCIceCandidate. toJSON()

RTCIceCandidate 메소드인 toJSON() 은 JSON 형식으로 호출된 RTCIceCandidate를 RTCIceCandidateInit (en-US) 객체 형식으로 변환합니다. .

Syntax

js
json = RTCIceCandidate.toJSON();

반환 값

RTCIceCandidateInit (en-US) 딕셔너리에 상응하는 객체로, RTCIceCandidate 객체의 해당하는 값으로 설정됩니다.

반환된 객체에 대한 문자열화된 버전의 객체는 stringify()를 호출해서 가져올 수 있습니다. 아래의 예시를 참조하십시오.

예시

아래의 샘플 코드는 candidate 변수의 RTCIceCandidate를 나타내는 JSON 문자열을 가져옵니다.

js
var jsonString = candidate.toJSON().stringify();

명세

Specification
WebRTC: Real-Time Communication in Browsers
# dom-rtcicecandidate-tojson

브라우저 호환성

BCD tables only load in the browser