PSA: RTCPeerConnection.onnegotiationneeded does not fire redundantly in M66

385 views
Skip to first unread message

hb...@webrtc.org

unread,
Feb 15, 2018, 12:21:34 PM2/15/18
to discuss-webrtc
According to the spec, the peer connection should maintain a flag to ensure onnegotiationneeded is not fired redundantly.
When something causes negotiationneeded an event is queued to fire the event if the flag has not been reset and to reset the flag. So if multiple events are queued at the same time only one should fire.
With this bug fix (issue) the assumption of some apps may need to update.

For example:

pc.onnegotiationneeded = () => { console.log('Negotiation needed!'); }
pc.addTrack(stream.getTracks()[0], stream);
pc.addTrack(stream.getTracks()[1], stream);

Before Chrome M66 this fires twice, now it only fires once. The same applies if you call addStream() twice in a row.
This fix is available in Canary.
Reply all
Reply to author
Forward
0 new messages