let bestCandidate = {
candidate: "",
sdpMid: null,
sdpMLineIndex: null,
priority: 0,
};
function handleCandidate(candidateString) {
const candidate = new RTCIceCandidate(candidateString);
if (candidate.priority > bestCandidate.priority) {
bestCandidate = candidate;
}
}RTCIceCandidate: priority property / notebook
RTCIceCandidate: priority property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.