RTCPeerConnection.getTransceivers()

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

Syntax

transceiverList = rtcPeerConnection.getTransceivers();

Parameters

None.

Return value

An array of the RTCRtpTransceiver objects representing the transceivers handling sending and receiving all media on the RTCPeerConnection. The list is in the order in which the transceivers were added to the connection.

Example

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

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

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
getTransceivers
69
79
59
No
56
11
79
69
59
48
11
10.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/getTransceivers