Perfect Negotiation supports both endpoints sending offers. The pattern intelligently handles the
situation of "glare" (both peers making an offer at the same time, causing a collision) by having
one peer be "polite" and the other peer be "impolite". In the event of an offer collision, the
polite peer rolls back its offer in order to process the impolite peer's incoming offer. Once
back to the stable signaling state, the polite peer's
onnegotiationneeded fires again and a
follow-up O/A is completed.
Click both peers' Start button to create local streams. Then press the Swap Sending Track button to modify which transceiver is sending; this will be negotiated and displayed as a remote track on the other peer's iframe.
For more information about RTCPeerConnection, see Getting Started With WebRTC.View source on GitHub