[webrtc-extensions] Potential web compat issue with setOfferedRtpHeaderExtensions (#130)

jan-ivar has just created a new issue for https://github.com/w3c/webrtc-extensions:

== Potential web compat issue with setOfferedRtpHeaderExtensions ==
I'm concerned about web compat over [this line](https://w3c.github.io/webrtc-extensions/#dom-rtcrtptransceiver-setofferedrtpheaderextensions):
- _"2. If ext.[uri](https://www.w3.org/TR/webrtc/#dom-rtcrtpheaderextensioncapability-uri) value is not present in [[[HeaderExtensionsToOffer]]](https://w3c.github.io/webrtc-extensions/#dfn-headerextensionstooffer), [throw](https://webidl.spec.whatwg.org/#dfn-throw) a [NotSupportedError](https://webidl.spec.whatwg.org/#notsupportederror)."_

...where [[HeaderExtensionsToOffer]] is [implementation-defined](https://infra.spec.whatwg.org/#implementation-defined). If _uri_ is a fixed string, that's a potential web compat headache.

How is JS expected to use this API in a web compatible manner?
 1. Come up with a subset tested to work in all browsers (today)?
 2. Detect UA and pick from a map?
 3. Write JS to pre-filter their input to [setOfferedRtpHeaderExtensions](https://w3c.github.io/webrtc-extensions/#dom-rtcrtptransceiver-setofferedrtpheaderextensions) using [headerExtensionsToOffer](https://w3c.github.io/webrtc-extensions/#dom-rtcrtptransceiver-headerextensionstooffer)?

I found no example showing predicted use of this API, but I could imagine some sites being lazy and setting a fixed array and not testing it in all browsers before going to production. This might cause calls to outright fail in a particular browser; or even work today but fail later once some browser makes a change.

This might also create a situation where browsers find it difficult to make changes later.

Throwing also seems redundant, since JS can already read [[HeaderExtensionsToOffer]] using [headerExtensionsToOffer](https://w3c.github.io/webrtc-extensions/#dom-rtcrtptransceiver-headerextensionstooffer), and can query [headerExtensionsNegotiated](https://w3c.github.io/webrtc-extensions/#dom-rtcrtptransceiver-headerextensionsnegotiated) for the net result.

Given this, maybe it's better for web compat to allow user agents to ignore values not present in [[HeaderExtensionsToOffer]]?

Please view or discuss this issue at https://github.com/w3c/webrtc-extensions/issues/130 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 2 December 2022 22:19:43 UTC