This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

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 ⁨2020년 1월⁩.

{"* "}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

브라우저 호환성

참조