const ssNewCandidate = (signalMsg) => {
const candidate = new RTCIceCandidate(signalMsg.candidate);
const receivers = pc.getReceivers();
for (const receiver of receivers) {
const parameters = receiver.transport.iceTransport.getRemoteParameters();
if (parameters.usernameFragment === candidate.usernameFragment) {
return;
}
}
pc.addIceCandidate(candidate).catch(window.reportError);
};RTCIceCandidate: usernameFragment property / notebook
RTCIceCandidate: usernameFragment property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.