TsgcRTCPeerConnectionEvents › OnRTCRemoteCandidate

OnRTCRemoteCandidate Event

Fired when a remote ICE candidate is received; set Accept to False to drop it.

Syntax

property OnRTCRemoteCandidate: TsgcRTCRemoteCandidateEvent;
// TsgcRTCRemoteCandidateEvent = procedure(Sender: TObject; const aCandidate: string; var Accept: Boolean) of object

Default Value

Remarks

Raised every time the remote peer publishes an ICE candidate on the signalling channel. aCandidate contains the "candidate:..." SDP line. When Accept is True (the default) the candidate is added to the local ICE agent and included in connectivity checks; set Accept to False to ignore it, for example to drop relay candidates that would pin the traffic through a specific TURN server you do not trust.

Example

procedure TForm1.oRTCRemoteCandidate(Sender: TObject;
  const aCandidate: string; var Accept: Boolean);
begin
  // ... reject relayed candidates
  Accept := Pos(' typ relay', aCandidate) = 0;
end;

Back to Events