This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
From Tommy Widenflycht, July 31 (see mailing list for discussion): Today I would like to propose a small change to RTCSessionDescription and RTCIceCandidate which would make the much more flexible: [Constructor(optional Dictionary description)] interface RTCSessionDescription { attribute RTCSdpType type; attribute DOMString sdp; }; In short the single constructor takes an Dictionary which is expected to mimic its members, and the stringifier method is removed. This has the advantages of being extremely powerful: sd = new RTCSessionDescription(); sd.sdp = ...; sd.type = ...; sd = new RTCSessionDescription({sdp:"..."}); sd.type = ...; sd = new RTCSessionDescription({type:"answer", sdp:"..."}); sd = new RTCSessionDescription(JSON.parse(some_json_string)); sd2 = new RTCSessionDescription(sd); and in the other direction jsonified_sd = JSON.stringify(sd); There's some precedence in using a constructor like this in some of the base Event classes.
It's nice that the constructor takes an object rather than a string of JSON. I'll go ahead and add this to the spec. I'm not sure this cloning functionality works though: > sd2 = new RTCSessionDescription(sd);