adapter
adapter copied to clipboard
Firefox is missing getCapabilities() on RTCRtpSender/RTCRtpReceiver
Versions affected
Firefox up to 105 version adapter.js up to 8.1.2
Description
Firefox is missing getCapabilities() on RTCRtpSender/RTCRtpReceiver. It could be polyfilled but it would require async set of this method - proposed way is to parse generated offer to provide the API. I've prepared draft version for the polyfill, and could prepare PR if it's ok to have async polyfill initialization. The demo code is here - https://gist.github.com/JSmith01/2be86bc242d3c2b1c4a95cd3eedde239
I remember discussing that a couple of times but I can't find any public mention of this. Apart from requiring a different pattern (async initialization) it creates and destroys a peerconnection. Now that is a somewhat common pattern but not something a polyfill (which already does too many 😱 things) should do.
getCapabilities in general, due to being a sync API is problematic (see https://github.com/w3c/webrtc-extensions/issues/95) since some codecs can't be enumerated in a synchronous way.
A potential solution to solving that is a per-connection is shown here but nobody found the time to implement or specifiy it yet.
tagging @jan-ivar for actual implementation status
looks like it is there but implementation status seems to be :-|
This was added in bug 1531460 in Firefox 113.
@jan-ivar Is there any chance to see setCodecPreferences() API in FF in the nearest future?
Yes, it should land in Firefox Nightly 127 any day now (bug 1396922).
And since FF113 nobody noticed that RTCRtpSender.getCapabilities('video').headerExtensions lacks the rid extension?