초안
이 문서는 작성중입니다.
RTCPeerConnection
인터페이스는 로컬 컴퓨터와 원격 피어 간의 WebRTC 연결을 담당하며 원격 피어에 연결하기 위한 메서드들을 제공하고, 연결을 유지하고 연결 상태를 모니터링하며 더 이상 연결이 필요하지 않을 경우 연결을 종료합니다.
BCD tables only load in the browser
RTCPeerConnection()
- The
RTCPeerConnection()
constructor returns a newly-createdRTCPeerConnection
, which represents a connection between the local device and a remote peer. canTrickleIceCandidates
- The read-only
RTCPeerConnection
propertycanTrickleIceCandidates
returns aBoolean
which indicates whether or not the remote peer can accept trickled ICE candidates. connectionState
- The read-only
connectionState
property of theRTCPeerConnection
interface indicates the current state of the peer connection by returning one of the string values specified by the enumRTCPeerConnectionState
. currentLocalDescription
undefined- The read-only property
RTCPeerConnection.currentLocalDescription
returns anRTCSessionDescription
object describing the local end of the connection as it was most recently successfully negotiated since the last time theRTCPeerConnection
finished negotiating and connecting to a remote peer. Also included is a list of any ICE candidates that may already have been generated by the ICE agent since the offer or answer represented by the description was first instantiated. currentRemoteDescription
undefined- The read-only property
RTCPeerConnection.currentRemoteDescription
returns anRTCSessionDescription
object describing the remote end of the connection as it was most recently successfully negotiated since the last time theRTCPeerConnection
finished negotiating and connecting to a remote peer. Also included is a list of any ICE candidates that may already have been generated by the ICE agent since the offer or answer represented by the description was first instantiated. getDefaultIceServers()
- The
getDefaultIceServers()
method of theRTCPeerConnection
interface returns an array of objects based on theRTCIceServer
dictionary, which indicates what, if any, ICE servers the browser will use by default if none are provided to theRTCPeerConnection
in itsRTCConfiguration
. However, browsers are not required to provide any default ICE servers at all. iceConnectionState
undefined- The read-only property
RTCPeerConnection.iceConnectionState
returns an enum of typeRTCIceConnectionState
which state of the ICE agent associated with theRTCPeerConnection
. iceGatheringState
undefined- The read-only property
RTCPeerConnection.iceGatheringState
returns an enum of typeRTCIceGatheringState
that describes connection's ICE gathering state. This lets you detect, for example, when collection of ICE candidates has finished. localDescription
undefined- The read-only property
RTCPeerConnection.localDescription
returns anRTCSessionDescription
describing the session for the local end of the connection. If it has not yet been set, this isnull
. peerIdentity
undefined- The read-only
RTCPeerConnection
propertypeerIdentity
returns a JavaScriptPromise
that resolves to anRTCIdentityAssertion
which contains aDOMString
identifying the remote peer. pendingLocalDescription
undefined- The read-only property
RTCPeerConnection.pendingLocalDescription
returns anRTCSessionDescription
object describing a pending configuration change for the local end of the connection. This does not describe the connection as it currently stands, but as it may exist in the near future. UseRTCPeerConnection.currentLocalDescription
orRTCPeerConnection.localDescription
to get the current state of the endpoint. For details on the difference, see/en-US/docs/Web/API/WebRTC_API/Connectivity
. pendingRemoteDescription
undefined- The read-only property
RTCPeerConnection.pendingRemoteDescription
returns anRTCSessionDescription
object describing a pending configuration change for the remote end of the connection. This does not describe the connection as it currently stands, but as it may exist in the near future. UseRTCPeerConnection.currentRemoteDescription
orRTCPeerConnection.remoteDescription
to get the current session description for the remote endpoint. For details on the difference, see/en-US/docs/Web/API/WebRTC_API/Connectivity
. remoteDescription
undefined- The read-only property
RTCPeerConnection.remoteDescription
returns aRTCSessionDescription
describing the session (which includes configuration and media information) for the remote end of the connection. If this hasn't been set yet, this isnull
. sctp
- The read-only
sctp
property on theRTCPeerConnection
interface returns anRTCSctpTransport
describing the SCTP transport over which SCTP data is being sent and received. If SCTP hasn't been negotiated, this value isnull
. signalingState
undefined- The read-only
signalingState
property on theRTCPeerConnection
interface returns one of the string values specified by theRTCSignalingState
enum; these values describe the state of the signaling process on the local end of the connection while connecting or reconnecting to another peer. See/en-US/docs/Web/API/WebRTC_API/Session_lifetime
for more details about the signaling process. onaddstream
- The
RTCPeerConnection.onaddstream
event handler is a property containing the code to execute when theaddstream
event, of typeMediaStreamEvent
, is received by thisRTCPeerConnection
. Such an event is sent when aMediaStream
is added to this connection by the remote peer. The event is sent immediately after the callRTCPeerConnection.setRemoteDescription
and doesn't wait for the result of the SDP negotiation. onconnectionstatechange
- The
RTCPeerConnection.onconnectionstatechange
property specifies anEventHandler
which is called to handle theconnectionstatechange
event when it occurs on an instance ofRTCPeerConnection
. This happens whenever the aggregate state of the connection changes. ondatachannel
- The
RTCPeerConnection.ondatachannel
property is anEventHandler
which specifies a function which is called when thedatachannel
event occurs on anRTCPeerConnection
. This event, of typeRTCDataChannelEvent
, is sent when anRTCDataChannel
is added to the connection by the remote peer callingRTCPeerConnection.createDataChannel
. onicecandidate
- The
RTCPeerConnection
propertyRTCPeerConnection.onicecandidate
property is anEventHandler
which specifies a function to be called when theicecandidate
event occurs on anRTCPeerConnection
instance. This happens whenever the local ICE agent needs to deliver a message to the other peer through the signaling server. oniceconnectionstatechange
- The
RTCPeerConnection.oniceconnectionstatechange
property is an event handler which specifies a function to be called when theiceconnectionstatechange
event is fired on anRTCPeerConnection
instance. This happens when the state of the connection's ICE agent, as represented by theRTCPeerConnection.iceConnectionState
property, changes. onicegatheringstatechange
- The
RTCPeerConnection.onicegatheringstatechange
property is anEventHandler
which specifies a function to be called when theicegatheringstatechange
event is sent to anRTCPeerConnection
instance. This happens when the ICE gathering state—that is, whether or not the ICE agent is actively gathering candidates—changes. onidentityresult
- The
RTCPeerConnection.onidentityresult
event handler is a property containing the code to execute when theidentityresult
event, of typeRTCIdentityEvent
, is received by thisRTCPeerConnection
. Such an event is sent when an identity assertion is generated, viaRTCPeerConnection.getIdentityAssertion()
or during the creation of an offer or an answer. onidpassertionerror
- The
RTCPeerConnection.onidpassertionerror
event handler is a property containing the code to execute whent theidpassertionerror
event, of typeRTCIdentityErrorEvent
, is received by thisRTCPeerConnection
. Such an event is sent when the associated identity provider (IdP) encounters an error while generating an identity assertion. onidpvalidationerror
- The
RTCPeerConnection.onidpvalidationerror
event handler is a property containing the code to execute whent theidpvalidationerror
event, of typeRTCIdentityErrorEvent
, is received by thisRTCPeerConnection
. Such an event is sent when the associated identity provider (IdP) encounters an error while validating an identity assertion. onnegotiationneeded
- The
RTCPeerConnection
interface'sonnegotiationneeded
property is anEventListener
which specifies a function which is called to handle thenegotiationneeded
event when it occurs on anRTCPeerConnection
instance. This event is fired when a change has occurred which requires session negotiation. This negotiation should be carried out as the offerer, because some session changes cannot be negotiated as the answerer. onpeeridentity
- The
RTCPeerConnection.onpeeridentity
event handler is a property containing the code to execute whent thepeeridentity
event, of typeEvent
, is received by thisRTCPeerConnection
. Such an event is sent when an identity assertion, received from a peer, has been successfully validated. onremovestream
- The
removestream
event has been removed from the WebRTC specification in favor of the existingremovetrack
event on the remoteMediaStream
and the correspondingMediaStream.onremovetrack
event handler property of the remoteMediaStream
. TheRTCPeerConnection
API is now track-based, so having zero tracks in the remote stream is equivalent to the remote stream being removed and the old removestream event. onsignalingstatechange
- The
onsignalingstatechange
event handler property of theRTCPeerConnection
interface specifies a function to be called when thesignalingstatechange
event occurs on anRTCPeerConnection
interface. ontrack
- The
RTCPeerConnection
propertyontrack
is anEventHandler
which specifies a function to be called when thetrack
event occurs, indicating that a track has been added to theRTCPeerConnection
. addIceCandidate()
- When a web site or app using
RTCPeerConnection
receives a new ICE candidate from the remote peer over its signaling channel, it delivers the newly-received candidate to the browser's ICE agent by callingRTCPeerConnection.addIceCandidate()
. addStream()
- The obsolete
RTCPeerConnection
methodaddStream()
adds aMediaStream
as a local source of audio or video. Instead of using this obsolete method, you should instead useRTCPeerConnection.addTrack
once for each track you wish to send to the remote peer. addTrack()
- The
RTCPeerConnection
methodaddTrack()
adds a new media track to the set of tracks which will be transmitted to the other peer. close()
- The
RTCPeerConnection.close()
method closes the current peer connection. createAnswer()
- The
createAnswer()
method on theRTCPeerConnection
interface creates an SDP answer to an offer received from a remote peer during the offer/answer negotiation of a WebRTC connection. The answer contains information about any media already attached to the session, codecs and options supported by the browser, and any ICE candidates already gathered. The answer is delivered to the returnedPromise
, and should then be sent to the source of the offer to continue the negotiation process. createDataChannel()
- The
createDataChannel()
method on theRTCPeerConnection
interface creates a new channel linked with the remote peer, over which any kind of data may be transmitted. createOffer()
- The
createOffer()
method of theRTCPeerConnection
interface initiates the creation of an SDP offer for the purpose of starting a new WebRTC connection to a remote peer. generateCertificate() static function
- The static
RTCPeerConnection.generateCertificate()
function creates an X.509 certificate and corresponding private key, returning a promise that resolves with the newRTCCertificate
once it's generated. getConfiguration()
- The
RTCPeerConnection.getConfiguration()
method returns anRTCConfiguration
object which indicates the current configuration of theRTCPeerConnection
on which the method is called. getIdentityAssertion()
- The
RTCPeerConnection.getIdentityAssertion()
method initiates the gathering of an identity assertion. This has an effect only if theRTCPeerConnection.signalingState
is not"closed"
. getReceivers()
- The
RTCPeerConnection.getReceivers()
method returns an array ofRTCRtpReceiver
objects, each of which represents one RTP receiver. Each RTP receiver manages the reception and decoding of data for aMediaStreamTrack
on anRTCPeerConnection
getSenders()
- The
RTCPeerConnection
methodgetSenders()
returns an array ofRTCRtpSender
objects, each of which represents the RTP sender responsible for transmitting one track's data. getStats()
- The
RTCPeerConnection
methodgetStats()
returns a promise which resolves with data providing statistics about either the overall connection or about the specifiedMediaStreamTrack
. getStreamById()
- The
RTCPeerConnection.getStreamById()
method returns theMediaStream
with the given id that is associated with local or remote end of the connection. If no stream matches, it returnsnull
. getTransceivers()
- The
RTCPeerConnection
interface'sgetTransceivers()
method returns a list of theRTCRtpTransceiver
objects being used to send and receive data on the connection. removeStream()
- The
RTCPeerConnection.removeStream()
method removes aMediaStream
as a local source of audio or video. If the negotiation already happened, a new one will be needed for the remote peer to be able to use it. Because this method has been deprecated, you should instead useRTCPeerConnection.removeTrack
if your target browser versions have implemented it. removeTrack()
- The
RTCPeerConnection.removeTrack()
method tells the local end of the connection to stop sending media from the specified track, without actually removing the correspondingRTCRtpSender
from the list of senders as reported byRTCPeerConnection.getSenders()
. restartIce()
- The WebRTC API's
RTCPeerConnection
interface offers therestartIce()
method to allow a web application to easily request that ICE candidate gathering be redone on both ends of the connection. setConfiguration()
- The
RTCPeerConnection.setConfiguration()
method sets the current configuration of theRTCPeerConnection
based on the values included in the specifiedRTCConfiguration
object. This lets you change the ICE servers used by the connection and which transport policies to use. setIdentityProvider()
- The
RTCPeerConnection.setIdentityProvider()
method sets the Identity Provider (IdP) to the triplet given in parameter: its name, the protocol used to communicate with it (optional) and an optional username. The IdP will be used only when an assertion is needed. setLocalDescription()
- The
RTCPeerConnection
methodRTCPeerConnection.setLocalDescription
changes the local description associated with the connection. This description specifies the properties of the local end of the connection, including the media format. setRemoteDescription()
- The
RTCPeerConnection
methodsetRemoteDescription()
sets the specified session description as the remote peer's current offer or answer. The description specifies the properties of the remote end of the connection, including the media format. RTCPeerConnection.createDTMFSender()
- 특정
MediaStreamTrack
와 관련된 신규RTCDTMFSender
를 생성합니다.RTCDTMFSender
는 연결을 통해 DTMF 전화 신호를 보낼 수 있습니다. connectionstatechange
RTCPeerConnection
의 연결상태가 바뀌면,RTCPeerConnection
객체에 전달합니다. 이는 또한,onconnectionstatechange
이벤트 핸들러 속성을 통해 사용이 가능합니다.datachannel
- 원격 피어가
RTCDataChannel
을 연결에 추가하게되면RTCPeerConnection
객체에 전달합니다. 이는 또한,ondatachannel
이벤트 핸들러 속성을 통해 사용이 가능합니다. icecandidate
- 특정 ICE candidate가 원격 피어에 전달되도록 피어 연결에 요청을 보냅니다. 또한,
onicecandidate
이벤트 핸들러 속성을 통해 사용이 가능합니다. icecandidateerror
- ICE candidate를 수집하는 과정에서 에러가 발생하면 연결에
RTCPeerConnectionIceErrorEvent
에러 타입을 보냅니다. 이는 또한,onicecandidateerror
이벤트 핸들러 속성을 통해 사용이 가능합니다. iceconnectionstatechange
- 연결이 끊기는 상황과 같이 ICE 연결의 상태가 변하게되면
RTCPeerConnection
에 전달합니다. 이는 또한,oniceconnectionstatechange
이벤트 핸들러 속성을 통해 사용이 가능합니다. icegatheringstatechange
iceGatheringState
에 의해 반영되는 ICE 계층의 수집 상태가 변하면,RTCPeerConnection
에 전달합니다. 계층의 수집 상태는 ICE 네고시에이션이 아직 시작을 안했거나 (new
), 시작하고 candidate를 수집하는 중이거나 (gathering
), 혹은 수집이 완료 (complete
)된 상태로 나눠집니다. 이는 또한,onicegatheringstatechange
이벤트 핸들러 속성을 통해 사용이 가능합니다.isolationchange
- 연결과 관련이 있는 하나의
MediaStreamTrack
객체가 있는isolated
속성의 값이 변하면,RTCPeerConnection
에 전달합니다. 만약 미디어 컨텐츠가 인증이 되어있지 않거나, 트랙이 cross-origin source (CORS)에서 오는 것이라면 트랙의 상태는isolated
이 됩니다. 이는 또한,onisolationchange
이벤트 핸들러 속성을 통해 사용이 가능합니다. negotiationneeded
- ICE 연결의 네고시에이션 혹은 네고시에이션을 다시 수행해야 할 때,
RTCPeerConnection
에 전달됩니다. 이는 연결이 처음 생성되는 순간뿐만아니라 네트워크 조건이 바뀌게 되면 발생합니다. 리시버는 offer를 생성하고, 이를 다른 피어에 전달하기위해 응답해야합니다. 이는 또한,onnegotiationneeded
이벤트 핸들러 속성을 통해 사용이 가능합니다. signalingstatechange
- 연결의 ICE 신호 상태가 변경되면
signalingstatechange
이벤트를RTCPeerConnection
에 전달합니다. 이는 또한,onsignalingstatechange
이벤트 핸들러 속성을 통해 사용이 가능합니다. statsended
- 모니터링이 되던 statistics 객체가 삭제되면,
statsended
이벤트를 전달합니다.RTCStatsEvent
는 삭제된 객체의 마지막 리포트를 포함합니다. 마지막 리포트를 전달받고나서 여러개의 객체가 삭제되었다면, 여러 객체에 대한 마지막 리포트를 포함합니다. 예를 들어 연결이 종료되거나 삭제되면, statistics 객체는 삭제됩니다. - The
statsended
event is sent when a statistics object being monitored is deleted. TheRTCStatsEvent
includes the final report on the deleted object (or objects, if multiple objects have been deleted since the last report was delivered). A statistics object is deleted, for example, when the connection is closed and deleted.
Available as theonstatsended
event handler property. track
- 연결을 구성하고 있는
RTCRtpReceiver
인스턴스들 중 하나에 신규 트랙이 추가된 후에,track
이벤트를 보냅니다. 이는 또한,ontrack
이벤트 핸들러 속성을 통해 사용이 가능합니다. addstream
- Sent when a new
MediaStream
has been added to the connection. Instead of watching for this obsolete event, you should watch each fortrack
events; one is sent for eachMediaStreamTrack
added to the connection.
Available as theonaddstream
event handler property. identityresult
- In old versions of the WebRTC specification, this event was used to indicate that an identity assertion is available. Now, you should instead wait for a the promise returned by
peerIdentity
to resolve with an identity.
Also available using theonidentityresult
event handler property. idpassertionerror
- In old versions of the WebRTC specification, this event was used to indicate that an error occurred while attempting to generate an identity assertion. Now, you should instead wait for a the promise returned by
peerIdentity
to be rejected with an error.
Also available as theonidpinsertionerror
event handler property. idpvalidationerror
- In old versions of the WebRTC specification, this event was used to indicate that an error occurred while attempting to validate an identity assertion. Now, you should instead wait for a the promise returned by
peerIdentity
to be rejected with an error.
Also available using theonpeerdentity
event handler property. peeridentity
- In old versions of the WebRTC specification, this event was used to deliver a received identity. Now, you should instead wait for a the promise returned by
peerIdentity
to resolve with an identity. removestream
- Sent to the
RTCPeerConnection
when aMediaStream
is removed from the connection. Instead of watching for this obsolete event, you should watch each stream forremovetrack
events on each stream within theRTCPeerConnection
.
Also available as theonaddstream
event handler property. - https://github.com/jesup/nightly-gupshup/blob/master/static/js/chat.js
- http://www.html5rocks.com/en/tutorials/webrtc/basics/#toc-simple
- TutorRoom: Node.js HTML5 video capture, peer-to-peer video and filesharing application (source on GitHub)
Also inherits properties from: EventTarget
Also inherits 이벤트 핸들러 from: EventTarget
Also inherits methods from: EventTarget
다음 메서드는 오래 전부터 사용되지 않았으며 모든 주요 브라우저에서 구현되지 않았습니다.
addEventListener()
를 이용하여 아래 이벤트를 리스닝하거나 이 인터페이스의 oneventname
프로퍼티에 이벤트 리스너를 할당할 수 있습니다.
The RTCBundlePolicy
enum defines string constants which are used to request a specific policy for gathering ICE candidates if the remote peer isn't compatible with the SDP BUNDLE standard for bundling multiple media streams on a single transport link.
In technical terms, a BUNDLE lets all media flow between two peers flow across a single 5-tuple; that is, from the same IP and port on one peer to the same IP and port on the other peer, using the same transport protocol.
상수명 | 설명 |
---|---|
"balanced" |
On BUNDLE-aware connections, the ICE agent should gather candidates for all of the media types in use (audio, video, and data). Otherwise, the ICE agent should only negotiate one audio and video track on separate transports. |
"max-compat" |
The ICE agent should gather candidates for each track, using separate transports to negotiate all media tracks for connections which aren't BUNDLE-compatible. |
"max-bundle" |
The ICE agent should gather candidates for just one track. If the connection isn't BUNDLE-compatible, then the ICE agent should negotiate just one media track. |
The RTCIceConnectionState
enum defines the string constants used to describe the current state of the ICE agent and its connection to the ICE server (that is, the STUN or TURN server).
상수명 | 설명 |
---|---|
"new" |
The ICE agent is gathering addresses or is waiting to be given remote candidates through calls to RTCPeerConnection.addIceCandidate() (or both). |
"checking" |
The ICE agent has been given one or more remote candidates and is checking pairs of local and remote candidates against one another to try to find a compatible match, but has not yet found a pair which will allow the peer connection to be made. It's possible that gathering of candidates is also still underway. |
"connected" |
A usable pairing of local and remote candidates has been found for all components of the connection, and the connection has been established. It's possible that gathering is still underway, and it's also possible that the ICE agent is still checking candidates against one another looking for a better connection to use. |
"completed" |
The ICE agent has finished gathering candidates, has checked all pairs against one another, and has found a connection for all components. |
"failed" |
The ICE candidate has checked all candidates pairs against one another and has failed to find compatible matches for all components of the connection. It is, however, possible that the ICE agent did find compatible connections for some components. |
"disconnected" |
Checks to ensure that components are still connected failed for at least one component of the RTCPeerConnection . This is a less stringent test than "failed" and may trigger intermittently and resolve just as spontaneously on less reliable networks, or during temporary disconnections. When the problem resolves, the connection may return to the "connected" state. |
"closed" |
The ICE agent for this RTCPeerConnection has shut down and is no longer handling requests. |
RTCPeerConnection.iceGatheringState
속성을 사용하게되면 반환되는 RTCIceGatheringState
enum은 현재의 ICE 수집 상태를 반영하여 알려주는 문자열 상수입니다. icegatheringstatechange
타입의 이벤트를 감시해서 이 값이 언제 변하는지 확인 할 수 있습니다.
상수명 | 설명 |
---|---|
"new" |
피어 연결이 새로 생성되었지만, 아직 네트워킹은 시작되지 않은 상태 |
"gathering" |
ICE 에이전트가 연결을 위한 ICE candidate를 수집하는 과정에 있음을 알려주는 상태 |
"complete" |
ICE 에이전트가 candidate 수집을 완료한 상태. 새로운 인터페이스가 추가되거나, 신규 ICE 서버가 추가와 같이 신규 ICE candidate를 수집해야하는 상황이 오면, 상태가 complete 에서 gathering 으로 다시 바뀝니다. |
The RTCIceTransportPolicy
enum defines string constants which can be used to limit the transport policies of the ICE candidates to be considered during the connection process.
상수명 | 설명 |
---|---|
"all" |
All ICE candidates will be considered. |
"public" |
Only ICE candidates with public IP addresses will be considered. Removed from the specification's May 13, 2016 working draft. |
"relay" |
Only ICE candidates whose IP addresses are being relayed, such as those being passed through a TURN server, will be considered. |
RTCPeerConnectionState
enum은 RTCPeerConnection
이 존재 할 수 도있는 상태에 대해 알려주는 문자열 상수를 정의합니다. 이 값들은 {domxref("RTCPeerConnection.connectionState", "connectionState")}} 속성에 의해 반홥됩니다. 근본적으로 이 상태는 연결에 의해 사용되는 모든 ICE 전송 (RTCIceTransport
혹은 RTCDtlsTransport
의 타입)의 상태 집합을 나타냅니다.
상수명 | 설명 |
---|---|
"new" |
연결의 ICE 전송 중 적어도 한 개가 새로 만들어진 |
"connecting" |
하나 혹은 여러개의 ICE 전송이 현재 연결을 구성하는 중에 있음을 알려주는 값. 이는 RTCIceConnectionState 가 "checking" 혹은 "connected" 이며, 그 어떤 전송도 "failed" 상태가 아니여야합니다. <<< Make this a link once I know where that will be documented |
"connected" |
연결에 의해 사용되는 모든 ICE 전송이 사용 중 ("connected" 혹은 "completed" )이거나, 종료된 상태입니다. 추가적으로 최소 하나의 전송이 "connected" 혹은 "completed" 입니다. |
"disconnected" |
연결에 대한 최소 한 개의 ICE 전송이 "disconnected" 상태이고, 그 외의 다른 전송 상태는 "failed" , "connecting" , 혹은 "checking" 이 아님을 알려주는 값. |
"failed" |
연결에 대한 하나 혹은 여러개의 ICE 전송이 |
"closed" |
2016년 5월 13일에 작성된 명세서의 초안에 따르면, 이 값은 |
The RTCRtcpMuxPolicy
enum defines string constants which specify what ICE candidates are gathered to support non-multiplexed RTCP. <<<add a link to info about multiplexed RTCP.
상수명 | 설명 |
---|---|
"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. |
The RTCSignalingState
enum specifies the possible values of RTCPeerConnection.signalingState
, which indicates where in the process of signaling the exchange of offer and answer the connection currently is.
상수명 | 설명 |
---|---|
"stable" |
There is no ongoing exchange of offer and answer underway. This may mean that the RTCPeerConnection object is new, in which case both the localDescription and remoteDescription are null ; it may also mean that negotiation is complete and a connection has been established. |
"have-local-offer" |
The local peer has called RTCPeerConnection.setLocalDescription() , passing in SDP representing an offer (usually created by calling RTCPeerConnection.createOffer() ), and the offer has been applied successfully. |
"have-remote-offer" |
The remote peer has created an offer and used the signaling server to deliver it to the local peer, which has set the offer as the remote description by calling RTCPeerConnection.setRemoteDescription() . |
"have-local-pranswer" |
The offer sent by the remote peer has been applied and an answer has been created (usually by calling RTCPeerConnection.createAnswer() ) and applied by calling RTCPeerConnection.setLocalDescription() . This provisional answer describes the supported media formats and so forth, but may not have a complete set of ICE candidates included. Further candidates will be delivered separately later. |
"have-remote-pranswer" |
A provisional answer has been received and successfully applied in response to an offer previously sent and established by calling setLocalDescription() . |
"closed" |
The connection is closed. This value moved into the |
사양명 | 상태 | 설명 |
---|---|---|
WebRTC 1.0: Real-time Communication Between Browsers The definition of 'RTCPeerConnection' in that specification. |
Candidate Recommendation | 초기 정의. |