adapter icon indicating copy to clipboard operation
adapter copied to clipboard

Firefox is missing getCapabilities() on RTCRtpSender/RTCRtpReceiver

Open JSmith01 opened this issue 2 years ago • 2 comments

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

JSmith01 avatar Oct 03 '22 15:10 JSmith01

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.

fippo avatar Oct 13 '22 08:10 fippo

tagging @jan-ivar for actual implementation status

fippo avatar Oct 14 '22 13:10 fippo

looks like it is there but implementation status seems to be :-|

fippo avatar Apr 20 '24 23:04 fippo

This was added in bug 1531460 in Firefox 113.

jan-ivar avatar Apr 22 '24 21:04 jan-ivar

@jan-ivar Is there any chance to see setCodecPreferences() API in FF in the nearest future?

JSmith01 avatar Apr 23 '24 14:04 JSmith01

Yes, it should land in Firefox Nightly 127 any day now (bug 1396922).

jan-ivar avatar Apr 23 '24 21:04 jan-ivar

And since FF113 nobody noticed that RTCRtpSender.getCapabilities('video').headerExtensions lacks the rid extension?

fippo avatar Apr 25 '24 01:04 fippo