HenrikJoreteg / webrtc.js

WebRTC abstraction for managing it simple to manage multiple peer connections of various types.
http://simplewebrtc.com
158 stars 33 forks source link

Send notification on end of candidates #8

Closed shimaore closed 10 years ago

shimaore commented 10 years ago

This is required in some situations, for example when the signaling API requires a complete SDP instead of accepting ICE candidates as-you-go. If the completion event is dropped, the SDP is never sent out. I suggest to either send a different message (proposed here), which has the advantage of not breaking the existing API for this module, or to do it the WebRTC way:

this.send('candidate');
fippo commented 10 years ago

I don't think this can work (currently even)... RTCPeerconnection emits 'endOfCandidates' when ice gathering is completed, not an empty candidate, see https://github.com/HenrikJoreteg/RTCPeerConnection/blob/master/rtcpeerconnection.js#L338

I'd rather have a non-trickle mode in rtcpeerconnection that only calls the createoffer-callback once gathering is done.

shimaore commented 10 years ago

@fippo yup, my bad.

Regarding non-trickle mode, I implemented a gatherer using the npm sdp module, I'll integrate that into a solution that relies on endOfCandidates and post when that's ready.