werift-webrtc icon indicating copy to clipboard operation
werift-webrtc copied to clipboard

iceGatheringStateChange is never triggered.

Open 0wwafa opened this issue 1 year ago • 1 comments

pc1.addEventListener('iceGatheringStateChange', () => {
    if (pc1.iceGatheringState === 'complete') {
        console.log('ICE gathering complete for pc1');
        console.log('SDP:', pc1.localDescription.sdp);
    }
});

pc1.onicegatheringstatechange = () => {
	console.log('changed',pc1.localDescription.sdp);
    if (pc1.iceGatheringState === 'complete') {
        console.log('ICE gathering complete for pc1');
        console.log('SDP:', pc1.localDescription.sdp);
    }
};

both these functions are never triggered. Also, at the end of the ice gathering (and during) sdp should contain all the ice candidates gathered.

This works in a browser. Does not work with werift.

The purpose: I want to instantiate a datachannel. At the end of the ice gathering I want to create the offer with all the candidates inside the sdp. From a web browser I can do that. So after that I send the full offer, I get the full answer and the connection starts.

So in the end is only:

pc1 (create full offer) >> send offer to pc2. pc2 (create full answer) >> send answer to pc1 pc1: connect.

0wwafa avatar Sep 10 '24 01:09 0wwafa

I'm not sure of the situation where the iceGatheringStateChange event is not firing in werift, please write a reproduction code.

shinyoshiaki avatar Sep 20 '24 10:09 shinyoshiaki