Vito Lipari
Vito Lipari

Reputation: 869

Signaling on RTCPeerconnection

I wrote a simple code for testing RTCPeerconnection

peer = new RTCPeerconnection(...);
peer.onicecandidate = function(evt){
    console.log(evt.candidate); 
    // into the console
    // RTCIceCandidate {candidate: "candidate:... 1 udp ", sdpMLineIndex:0, sdpMid:"data"}
    // RTCIceCandidate {candidate: "candidate:... 2 udp ", sdpMLineIndex:0, sdpMid:"data"}
}

i want send it to signaling server but i receive it 2 times and 2 different values.

Have i to record all candidate values?

When i receive candidate information from signaling server, have i to receive all the values about the same peer?

I have too, localDescription // {type: "offer", sdp: "v=0↵o=- 6483...48 2 IN IP4 ...}

Have i to send it to signaling server and receive the description of other peer?

Upvotes: 0

Views: 525

Answers (1)

mido
mido

Reputation: 25054

I think you need to do bit more reading up on WebRTC, for a single PeerConnection, there could be many ICE candidates, you usually send it to remote peer through some signaling server, no point storing it in server, as they probably expire after a period of time.

this and this might be good place to read up on the basics.

Upvotes: 1

Related Questions