Add RTCIceCandidate::ToJSON

This commit is contained in:
Manish Goregaokar 2019-01-29 10:29:05 -08:00
parent b7e2e79e53
commit 0d9f538561
2 changed files with 11 additions and 1 deletions

View file

@ -98,4 +98,14 @@ impl RTCIceCandidateMethods for RTCIceCandidate {
fn GetUsernameFragment(&self) -> Option<DOMString> {
self.username_fragment.clone()
}
/// https://w3c.github.io/webrtc-pc/#dom-rtcicecandidate-tojson
fn ToJSON(&self) -> RTCIceCandidateInit {
RTCIceCandidateInit {
candidate: self.candidate.clone(),
sdpMid: self.sdp_m_id.clone(),
sdpMLineIndex: self.sdp_m_line_index.clone(),
usernameFragment: self.username_fragment.clone(),
}
}
}