w3c / webrtc-pc

WebRTC 1.0 API
https://w3c.github.io/webrtc-pc/
Other
433 stars 115 forks source link

track ietf bundlepolicy changes #2684

Open fippo opened 2 years ago

fippo commented 2 years ago

https://datatracker.ietf.org/meeting/111/materials/slides-111-rtcweb-aligning-jsep-and-bundle-00 seems to be the latest on that. tl;dr is max-bundle is deprecated and must-bundle needs to be added.

It also seems we have implementation issues, neither Chrome nor Firefox implement If the remote endpoint is not bundle-aware, negotiate only one media track. correctly, see this newly added test

jan-ivar commented 2 years ago

"The most common implementation differed from both of these specs"

Does this mean Chrome? Were other implementations fine (modulo "the remote endpoint is not bundle-aware" issue, which we should probably untangle unless it is core to this issue)?

"In order to prevent unexpected changes to applications relying on the pre-standard behavior, the decision was made to deprecate the use of "max-bundle" and instead introduce a new "must-bundle" policy that, when selected, provides the correct behavior."

Does "when selected" refer to the W3C API? I.e. is the request to update this API by add the following?

enum RTCBundlePolicy {
  "balanced",
  "max-compat",
  "max-bundle",
+ "must-bundle"
 };

...where the latter two are defined the same, with a note that says: "Don't use "max-bundle""?

Since WebIDL enums throw, are applications expected to feature-detect this? E.g. from now on:

let pc;
try {
  pc = new RTCPeerConnection({bundlePolicy: "must-bundle"});
} catch (e) {
  if (e.name != "TypeError") throw e;
  pc = new RTCPeerConnection({bundlePolicy: "max-bundle"});
}

Are we sure this is the best solution for web compat? The alternative would seem to be to leave the enum alone and specify that {bundlePolicy: "max-bundle"} means must-bundle in JSEP from now on. I'm not proposing we do that, merely noting it seems like this decision belongs in the W3C.

alvestrand commented 2 years ago

If one end does max-bundle and the other does must-bundle, will they interoperate?

jan-ivar commented 2 years ago

TL;DR: If we tell sites to start using {bundlePolicy: "must-bundle"} then this will throw on users with old browsers, because enums.

In contrast, new dictionary members are ignored by old browsers, so perhaps we could use that here? Something like (spitballing) {mustBundle: true}