RTCPeerConnection: getTransceivers() method

Baseline Widely available *

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

* Some parts of this feature may have varying levels of support.

The getTransceivers() method of the RTCPeerConnection interface returns a list of the RTCRtpTransceiver objects being used to send and receive data on the connection.

Syntax

js
getTransceivers()

Parameters

None.

Return value

An array of the RTCRtpTransceiver objects representing the transceivers handling sending and receiving all media on the RTCPeerConnection. The array is in the order in which the transceivers were added to the connection. The array does not include transceivers that have already been stopped (following offer/answer).

Examples

The following snippet of code stops all transceivers associated with an RTCPeerConnection.

js
pc.getTransceivers().forEach((transceiver) => {
  transceiver.stop();
});

Specifications

Specification
WebRTC: Real-Time Communication in Browsers
# dom-peerconnection-gettranseceivers

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
getTransceivers
Stopped transcievers not returned

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

See also