Edit: Frustration aside, this is a really nice explanation, thanks.
Furthermore, the SDP configurations that Windows Media Services emits can include a multi-kilobyte base64-encoded ASF configuration element. So it's not like applications can't choose to ignore such a rule, or agree on a standard that drops such a limitation.
If I had to guess why they used SDP it's because 1) it's simple to parse and 2) WebRTC also uses RTP, and RTP libraries already typically include or are accompanied by SDP libraries.
I dislike standards that provide so much rope for people to hang themselves. Multimedia standards are horrible rats nests of options, sub-options, and sub-sub-options, the vast majority of which nobody uses or even parse correctly. And while SDP is simple, it aids & abets such behavior by being such a generic format.
Still, it's common and there are plenty of standards which define various SDP configurations.
In context of WebRTP, SDP provides no benefits. Might as well used a JSON representation of the media negotiation, requiring no additional parser. Things are already ambiguous and poorly handled when using SDP in the real world. I think it must be something about "simple" permissive protocols that encourage implementation issues.
But you definitely helped clear up some of the rougher points for me. Like, I didn't realize that createOffer should be called after the negotiationNeeded event occurred. I just call it immediately after creating my DataChannel (I'm doing text-only transmissions as part of a system to combine inputs from multiple devices to play a game). I had wondered what the negotiationNeeded event was all about, but none of the articles I'd found had really said anything clear about it, and it wasn't in any of the example code I found.
And I found all of this through MDN! The existing documentation for WebRTC is apparently really bad. And that's quite disappointing, because I've usually found MDN to either be excellent or merely incomplete, not specifically having documentation that was poor.
Again, thanks for this.