RTCPeerConnection.getReceivers()
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.
RTCPeerConnection.getReceivers()
方法返回一个 RTCRtpReceiver
对象的数组,每个 RTCRtpReceiver 对象代表了一个 RTP receiver。每个 RTP receiver 管理在一个 RTCPeerConnection
上的 MediaStreamTrack
的数据的接收与解码。
语法
var receivers = rtcPeerConnection.getReceivers();
返回值
一个 RTCRtpReceiver
数组,一个对象就是连接上的一个轨道(track)。若连接上没有 RTP receiver,则数组为空。
规范没有定义返回的 RTCRtpReceiver 实例的顺序,所以两次调用 getReceivers()
返回的顺序可能是不同的。
例子
待定
规范
Specification |
---|
WebRTC: Real-Time Communication in Browsers # dom-peerconnection-getreceivers |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
getReceivers | ||||||||||||
Receivers for stopped transceivers not returned |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.