Reputation: 31
I use icegatheringstatechange event handler, but he didn't work. How I can catch icegatheringstate change? How do I know that all ice candidates added?
Upvotes: 1
Views: 381
Reputation: 6708
The icegatheringstatechange
event isn't implemented in all browsers (actually, I'm not aware of where it is implemented, but it's not implemented in Firefox). That's why your event handler isn't called.
If you want to know when all ice candidates are added, there will be an icecandidate
event dispatched with event.candidate = null
.
Here's the description of this behavior from the current editor's draft of the WebRTC spec:
candidate of type RTCIceCandidate, readonly , nullable
...
This attribute is set to
null
when an event is generated to indicate the end of candidate gathering.
Upvotes: 1