You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
RTCCertificate.generateCertificate(keygenAlgorithm).then(function(certificate){varcert=certificate;// Obtain the fingerprint of the created certificatedtlsParameters.fingerprints[0]=cert.fingerprint;},function(){trace('Certificate could not be created');});// Prepare to handle remote ICE candidatesmySignaller.onRemoteCandidate=function(remote){// Figure out which IceTranport a remote candidate relates to by matching the userNameFragment/passwordvarj=0;for(j=0;j<iceTransport.length;j++){vartransport=iceTransports[j];if(transport.getRemoteParameters().userNameFragment===remote.parameters.userNameFragment)transport.addRemoteCandidate(remote.candidate);}}};// ... create RtpSender/RtpReceiver objects as illustrated in Section 6.5 Example 9.mySignaller.mySendInitiate({"ice": iceGatherer.getLocalParameters(),"dtls": dtlsParameters,// ... marshall RtpSender/RtpReceiver capabilities as illustrated in Section 6.5 Example 9.},function(remote){// Create the ICE and DTLS transportsvariceTransport=newRTCIceTransport(iceGatherer);iceTransport.start(iceGatherer,remote.ice,RTCIceRole.controlling);iceTransports.push(iceTransport);// Construct a RTCDtlsTransport object with the same certificate and fingerprint as in the Offer// so that the remote peer can verify it.vardtlsTransport=newRTCDtlsTransport(iceTransport,cert);// <---- There is no `cert` vardtlsTransport.start(remote.dtls);dtlsTransports.push(dtlsTransport);// ... configure RtpSender/RtpReceiver objects as illustrated in Section 6.5 Example 9.});
In var dtlsTransport = new RTCDtlsTransport(iceTransport, cert); such a cert variable does not exist in that scope. It was defined in the resolve function of the RTCCertificate.generateCertificate() returned Promise.
For this to be valid, var cert should be declared above the RTCCertificate.generateCertificate() call.
// Create the DTLS certificatevarkeygenAlgorithm={name: "ECDSA",namedCurve: "P-256"};RTCCertificate.generateCertificate(keygenAlgorithm).then(function(certificate){varcert=certificate;},function(){trace('Certificate could not be created');});// Create ICE and DTLS transportsvarice=newRTCIceTransport(iceGatherer);vardtls=newRTCDtlsTransport(ice,cert);// `cert` does not exist in this scope.
Activity
ibc commentedon Dec 26, 2015
Some issue in Example 7:
ibc commentedon Dec 26, 2015
If I do not miss anything I will send a PR next week,
[-]Example 6 is wrong[/-][+]Examples 6 and 7 are wrong[/+]Examples 6 and 7 are wrong
aboba commentedon Dec 26, 2015
PR for this issue: #312
ibc commentedon Dec 27, 2015
Great, didn't see the PR.
Examples 6 and 7 are wrong
aboba commentedon Jan 4, 2016
Found similar problems in Examples 22 and 24. PR submitted to fix those as well as some respec errors: #319
[-]Examples 6 and 7 are wrong[/-][+]Examples 6, 7, 22 and 24 are wrong[/+]