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.
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.