Search code examples
firefoxwebrtc

Firfeox 87 on Ubuntu throws TypeError for RTCRtp[Sender|Receiver].getCapabilities


Is it a bug that Firefox throws a TypeError when RTCRtp[Sender|Receiver].getCapabilities("video") is executed in the Developer Tools console?

Firefox version is 87.0 with build number 20210318103112 on Ubuntu 20.04.
For comparison, Chrome Version 90.0.4430.40 (Official Build) beta (64-bit) returns the expected object containing codecs and headerExtensions.

The full error message for RTCRtpSender.getCapabilities in Firefox Developer Tools console is:

Uncaught TypeError: RTCRtpSender.getCapabilities is not a function
    <anonymous> debugger eval code:1

A screenshot of the Firefox Developer Tools showing the error and the Firefox version number: Screenshot showing error in Firefox 87 Developer Tools console


Solution

  • The static RTCRtpSender.getCapabilities method isn't implemented in Firefox. If you need to determine codec capabilities you'll need to create an offer and parse the SDP.