Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

sending userNameFragment in candidate ? Example 5 #237

@Jxck

Description

@Jxck

I have question about Example 5

https://github.com/openpeer/ortc/blob/master/ortc.html#L1523

  // Prepare to add ICE candidates signalled by the remote peer
  responseSignaller.onRemoteCandidate = function(remote) {
    // Locate the ICE transport that the signaled candidate relates to by matching the userNameFragment.
    var j = 0;
    for (j = 0; j < iceTransport.length; j++) {
      if (getRemoteParameters(iceTransport(j)).userNameFragment === remote.parameters.userNameFragment) {
        if (remote.component === RTCIceComponent.RTP) {
          iceRtpTransport[j].addRemoteCandidate(remote.candidate);
        } else {
          iceRtcpTransport[j].addRemoteCandidate(remote.candidate);
        }
      }
    }
  };

this code checked userNameFragment at each candidate from remote.params.
this means when local oncandidate happens, we need to send it to peer with userNameFragment like this ?

iceRtpGatherer.onlocalcandidate = function(event) {
  mySendLocalCandidate(event.candidate, RTCIceComponent.RTP, iceRtpGatherer.getLocalParameters());
}

in that case, we need to send getLocalParameter result twice ?
1 at send candidate, 2 at send parameters.

mySignaller.send({
  "icertp": iceRtpGatherer.getLocalParameters(), // same
  "icertcp": iceRtcpGatherer.getLocalParameters()
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions