TsgcRTCPeerConnection › Events › OnRTCRemoteCandidate
Fired when a remote ICE candidate is received; set Accept to False to drop it.
property OnRTCRemoteCandidate: TsgcRTCRemoteCandidateEvent;
// TsgcRTCRemoteCandidateEvent = procedure(Sender: TObject; const aCandidate: string; var Accept: Boolean) of object
—
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.
procedure TForm1.oRTCRemoteCandidate(Sender: TObject;
const aCandidate: string; var Accept: Boolean);
begin
// ... reject relayed candidates
Accept := Pos(' typ relay', aCandidate) = 0;
end;