RTCPeerConnection: getReceivers() 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.
ThegetReceivers() method of theRTCPeerConnection interface returns an array ofRTCRtpReceiver objects, each of which represents one RTP receiver.Each RTP receiver manages the reception and decoding of data for aMediaStreamTrack on anRTCPeerConnection.
In this article
Syntax
getReceivers()Parameters
None.
Return value
An array ofRTCRtpReceiver objects, one for each track on the connection.The array is empty if there are no RTP receivers on the connection.
The order of the returnedRTCRtpReceiver instances is not defined by the specification, and may change from one call togetReceivers() to the next.
The array does not include receivers associated with transceivers that have beenstopped (following offer/answer).
Example
tbd
Specifications
| Specification |
|---|
| WebRTC: Real-Time Communication in Browsers> # dom-peerconnection-getreceivers> |