The RTCPeerConnection interface's getTransceivers() method returns a list of the RTCRtpTransceiver objects being used to send and receive data on the connection.
On this page
RTCPeerConnection: getTransceivers() method
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
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 |
stopped_transceivers_removed |
88 | 88 | 118 | No | 74 | No | 88 | 88 | 118 | 63 | No | 15.0 |
See also
© 2005–2023 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