Event Properties
string
Event type. Always
"webrtc.signaling.iceCandidate" for this event.object
Event data object containing ICE candidate information.
object
The RTCIceCandidate object containing candidate information for network path discovery.Example:
Sending ICE Candidate
When ICE candidates are generated by your RTCPeerConnection, you need to send them immediately. Here’s how to send ICE candidates:candidate object should have the following properties:
candidate(string): The candidate string, e.g.,"candidate:1666409998 1 udp 2122129151 192.168.1.81 64301 typ host generation 0 ufrag lwyK network-id 1"sdpMLineIndex(number, optional): The SDP media line index, typically0for video or1for audiosdpMid(string, optional): The SDP media identification tag, typically"0"for video or"1"for audiousernameFragment(string, optional): The ICE username fragment (ufrag)
- The
candidateparameter indata.candidateshould be anRTCIceCandidateobject (or equivalent plain object) - Send ICE candidates immediately when they’re generated in the
onicecandidateevent handler - Only send candidates when
event.candidateis not null (when it’s null, ICE gathering is complete) - You may receive multiple ICE candidates - send each one as it’s generated
Receiving ICE Candidate
When you receive an ICE candidate, handle it like this:- When to send: Send ICE candidates immediately when they’re generated in the
peerConnection.onicecandidateevent handler - What to send: Send
event.candidate(which is an RTCIceCandidate object) as thecandidatevalue - Multiple candidates: You may receive multiple ICE candidates - send each one as it’s generated
- ICE candidates are sent through the unified WebSocket connection