- From: Bernard Aboba <Bernard.Aboba@microsoft.com>
- Date: Fri, 27 Jun 2014 17:59:56 +0000
- To: "public-ortc@w3.org" <public-ortc@w3.org>
Gilli asked: "why would you add the method on the listener, as opposed to whatever triggered the beginning of the gathering process in the first place (I assume you can gather candidates without a listener)?" [BA] In the forking case, multiple RTCIceTransport objects might need to be created, one for each response. In the Editor's draft this is illustrated in the example in Section 5.4 (see below). In such a case, all the RTCIceTransport objects would share credentials, so calling RTCIceTransport.restart() on any of them would have side effects on the others. =============================================== // Example to demonstrate forking when RTP and RTCP are not multiplexed. var iceOptions = ...; var iceRtpListener = new RTCIceListener(iceOptions); var iceBaseRtpTransport = new RTCIceTransport(iceRtpListener); //create the RTCP ICE transport var iceBaseRtcpTransport = iceBaseRtpTransport.createAssociatedTransport(); mySendInitiate( { "icertp": iceBaseRtpTransport.getLocalParameters(), "icertcp": iceBaseRtcpTransport.getLocalParameters() }, function(response) { // We may get N responses var iceRtpTransport = new RTCIceTransport(iceRtpListener); // Create new ice RTCP transport based on the (implicitly created) iceListener var iceRtcpTransport = iceRtpTransport.createAssociatedTransport(); // check to make sure the RTCRtpIceListener objects are set up as expected. assert(iceRtpTransport.iceListener == iceBaseRtpTransport.iceListener); assert(iceRtcpTransport.iceListener == iceBaseRtcpTransport.iceListener); iceRtpTransport.start(response.icertp, RTCIceRole.controlling); iceRtcpTransport.start(response.icertcp, RTCIceRole.controlling); // ... setup DTLS, RTP, SCTP, etc. }); iceBaseRtpTransport.onlocalcandidate = mySendLocalRtpCandidate; iceBaseRtcpTransport.onlocalcandidate = mySendLocalRtcpCandidate;
Received on Friday, 27 June 2014 18:00:25 UTC