RTCPeerConnection.getTransceivers()

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 인터페이스의 getTransceivers() 메소드는 연결에서 데이터 전송 및 수신에 사용되는 RTCRtpTransceiver 객체의 리스트를 반환합니다.

Syntax

js
transceiverList = RTCPeerConnection.getTransceivers();

매개변수

없음.

반환 값

RTCPeerConnection에 대한 모든 미디어의 전송/수신을 관리하는 트랜시버를 나타내는 RTCRtpTransceiver 객체의 배열입니다. 리스트의 순서는 트랜시버가 연결에 추가된 순서대로 정렬되어있습니다.

예시

아래 코드는 RTCPeerConnection와 연관된 모든 트랜시버를 중지시킵니다.

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

명세서

Specification
WebRTC: Real-Time Communication in Browsers
# dom-peerconnection-gettranseceivers

브라우저 호환성

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
getTransceivers
Stopped transcievers not returned

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support

참조