RTCPeerConnection()
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2017ë 9ì.
* Some parts of this feature may have varying levels of support.
RTCPeerConnection() ìì±ìë ë¡ì»¬ 기기ì ì격 í¼ì´ ê°ì ì°ê²°ì ëíë´ë RTCPeerConnection ê°ì²´ë¥¼ ìë¡ ë§ë¤ì´ ë°íí©ëë¤.
구문
pc = new RTCPeerConnection([configuration]);
매ê°ë³ì
configurationOptional-
ìë¡ì´ ì°ê²°ì ì¤ì íë ìµì ê°ì²´ì ëë¤.
bundlePolicyOptional-
ì격 í¼ì´ê° SDP BUNDLE íì¤ê³¼ í¸íëì§ ìì ë ì´ë»ê² candidateì ë¤ê³ ììì´ì ì ì²ë¦¬ í ê²ì¸ì§ë¥¼ ì ìí©ëë¤.
ê°ë¥í ê°ì ë¤ì ì´ê±°í ê° ì¤ íëë¡, 기본 ê°ì
balancedì ëë¤.balanced-
The ICE agent initially creates one
RTCDtlsTransportfor each type of content added: audio, video, and data channels. If the remote endpoint is not BUNDLE-aware, then each of these DTLS transports handles all the communication for one type of data. max-compat-
The ICE agent initially creates one
RTCDtlsTransportper media track and a separate one for data channels. If the remote endpoint is not BUNDLE-aware, everything is negotiated on these separate DTLS transports. max-bundle-
The ICE agent initially creates only a single
RTCDtlsTransportto carry all of theRTCPeerConnection's data. If the remote endpoint is not BUNDLE-aware, then only a single track will be negotiated and the rest ignored.
certificatesOptional-
ì°ê²° ì¸ì¦ì ì¬ì©í
RTCCertificate를 ë´ìArrayì ëë¤. ì§ì íì§ ìì ê²½ì°RTCPeerConnectionì¸ì¤í´ì¤ ê°ê°ì ëí´ ì¸ì¦ìê° ìëì¼ë¡ ìì±ë©ëë¤. 주ì´ì§ ì°ê²°ì ëí´ íëì ì¸ì¦ìë§ ì¬ì©ëì§ë§, ë¤ìí ìê³ ë¦¬ì¦ì ì¬ì©íë ì¬ë¬ ì¸ì¦ì를 ì ê³µíë©´ í¹ì ìí©ììì ì°ê²° ì±ê³µë¥ ì ëì¼ ì ììµëë¤. ìëì ì¸ì¦ì ì¬ì©í기ìì ë ë§ì ì 보를 íì¸íì¸ì.ì°¸ê³ : ì´ ìµì ì ì²ì ì§ì í ì´í ë³ê²½í ì ììµëë¤. ì¸ì¦ì를 ì¤ì í íì 모ë
RTCPeerConnection.setConfiguration()ì´ ë¬´ìë©ëë¤. iceCandidatePoolSizeOptional-
ICE candidate íì í¬ê¸°ë¥¼ ì§ì íë ë¶í¸ ìë 16ë¹í¸ ì ì ê°ì ëë¤. 기본 ê°ì 0ì¼ë¡ candidate 를 미리 ê°ì ¸ì¤ì§ ìì ê²ìì ëíë ëë¤. ì°ê²° ìë ì ë¶í° ICE ìì´ì í¸ê° ICE candidate를 ê°ì ¸ì¬ ì ìëë¡ íì©íë©´
RTCPeerConnection.setLocalDescription()í¸ì¶ ìì ì ì´ë¯¸ candidate를 ì¡°ì¬í ì ìì¼ë¯ë¡ í¹ì ìí©ìì ì°ê²° ìëê° ë¹¨ë¼ì§ ì ììµëë¤.ì°¸ê³ : ICE candidate íì í¬ê¸°ë¥¼ ë³ê²½íë©´ ICE ìì§ì´ ììí ì ììµëë¤.
iceServersOptional-
ICE ìì´ì í¸ê° ì¬ì©í ì ìë ìë²(ë³´íµ STUN/TURN)를 ì¤ëª íë
RTCIceServerê°ì²´ì ë°°ì´ì ëë¤. ì§ì íì§ ìì ê²½ì° STUN/TURN ìë²ë¥¼ ì¬ì©íì§ ìê³ ì°ê²° ìë를 íë¯ë¡ ì°ê²°ì´ ë¡ì»¬ í¼ì´ë¡ ì íë©ëë¤. iceTransportPolicyOptional-
íì¬ ICE í¸ëì¤í¬í¸ ì ì± ì ëë¤. ì§ì íì§ ìì ê²½ì° ê¸°ë³¸ ê°ì
allë¡, 모ë candidate를 ê³ ë ¤í©ëë¤. ê°ë¥í ê°ì ë¤ìê³¼ ê°ìµëë¤. peerIdentityOptional-
RTCPeerConnectionì ëì í¼ì´ ìì´ë´í°í°ë¥¼ ëíë´ëDOMStringì ëë¤. 기본 ê°ìnullì ëë¤. ì´ ê°ì ì§ì í ê²½ì°RTCPeerConnectionì 주ì´ì§ ì´ë¦ì¼ë¡ ì¸ì¦ì ì±ê³µí´ì¼ ì격 í¼ì´ë¡ ì°ê²°ì ìëí©ëë¤. rtcpMuxPolicyOptional-
non-multiplexed RTCP를 ì§ìí기 ìí´ ICE ìì§ ì¤ ì¬ì©í RTCP mux ì ì± ì ëë¤. ê°ë¥í ê°ì ë¤ìê³¼ ê°ìµëë¤.
negotiate-
Instructs the ICE agent to gather both RTP and RTCP candidates. If the remote peer can multiplex RTCP, then RTCP candidates are multiplexed atop the corresponding RTP candidates. Otherwise, both the RTP and RTCP candidates are returned, separately.
require-
Tells the ICE agent to gather ICE candidates for only RTP, and to multiplex RTCP atop them. If the remote peer doesn't support RTCP multiplexing, then session negotiation fails. This is the default value.
ë°í ê°
configurationì´ ì§ì ë ê²½ì° ê·¸ì ë§ê² 구ì±í, ê·¸ë ì§ ìì ê²½ì° ê¸°ë³¸ê° êµ¬ì±ì ì´ì©í RTCPeerConnection ê°ì²´ì
ëë¤.
ì¸ì¦ì ì¬ì©í기
When you wish to provide your own certificates for use by an
RTCPeerConnection instead of having the RTCPeerConnection
generate them automatically, you do so by calling the static
RTCPeerConnection.generateCertificate() function.
The certificates property's value cannot be changed once it's first
specified. If it's included in the configuration passed into a call to a connection's
setConfiguration(), it is ignored.
This attribute supports providing multiple certificates because even though a given
DTLS connection uses only one certificate, providing multiple certificates allows
support for multiple encryption algorithms. The implementation of
RTCPeerConnection will choose which certificate to use based on the
algorithms it and the remote peer support, as determined during DTLS handshake.
If you don't provide certificates, new ones are generated automatically. One obvious benefit to providing your own is identity key continuityâif you use the same certificate for subsequent calls, the remote peer can tell you're the same caller. This also avoids the cost of generating new keys.
ëª ì¸
| Specification |
|---|
| WebRTC: Real-Time Communication in Browsers > # dom-peerconnection > |