The SDP Offer/Answer Rules That Bite During WebRTC Renegotiation
WebRTC developers do not normally bother about an SDP blob. It just works in the initial negotiation, media streams are exchanged, and the details of the format are irrelevant. But once renegotiation happens — adding a track, starting a screen share, performing ICE restart — things break, and you get an error message as if it was meant for somebody else.
Failed to set remote answer sdp: The order of m-lines in answerdoesn't match order in offer. Rejecting answer.
There are some rules which generate these errors and they are quite simple but they remain hidden until you violate them. Here are a few of them which you should know in advance.
An SDP session description consists of a number of media sections, each of them starts with an m= line. And the order of media sections is important. Once a session is established, then for each offer/answer the n...
Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE