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

句法

transceiverList = rtcPeerConnection.getTransceivers();
					

参数

None.

返回值

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.

范例

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

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

规范

规范 状态 注释
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCPeerConnection.getTransceivers()' in that specification.
候选推荐

浏览器兼容性

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.

No compatibility data found. Please contribute data for "api.RTCPeerConnection.getTransceivers" (depth: 1) to the MDN 兼容性数据存储库 .

另请参阅

元数据

  • 最后修改: