setCodecPreferences method

void setCodecPreferences(
  1. JSArray<RTCRtpCodec> codecs
)

The RTCRtpTransceiver method setCodecPreferences() configures the transceiver's preferred list of codecs.

The specified set of codecs will be used for all future connections that include this transceiver until this method is called again.

When preparing to open an RTCPeerConnection, you can change the codec parameters from the default configuration by calling setCodecParameters() before calling either RTCPeerConnection.createOffer or RTCPeerConnection.createAnswer.

A guide to codecs supported by WebRTC—and each codec's positive and negative characteristics—can be found in Codecs used by WebRTC.

Implementation

external void setCodecPreferences(JSArray<RTCRtpCodec> codecs);