This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.
signalingState property on the
RTCPeerConnection interface returns one of the string values specified by the
RTCSignalingState 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 "Signaling" in Lifetime of a WebRTC session for more details about the signaling process.
Because the signaling process is a state machine, being able to verify that your code is in the expected state when messages arrive can help avoid unexpected and avoidable failures. For example, if you receive an answer while the
"have-local-offer", you know that something is wrong, since you should only receive answers after creating an offer but before an answer has been received and passed into
RTCPeerConnection.setLocalDescription(). Your code will be more reliable if you watch for mismatched states like this and handle them gracefully.
This value may also be useful during debugging, for example.
var state = RTCPeerConnection.signalingState;
The allowed values are those included in the enum
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.
||There is no ongoing exchange of offer and answer underway. This may mean that the
||The local peer has called
||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
||The offer sent by the remote peer has been applied and an answer has been created (usually by calling
||A provisional answer has been received and successfully applied in response to an offer previously sent and established by calling
||The connection is closed.|
var pc = new RTCPeerConnection(configuration); var state = pc.signalingState;
|WebRTC 1.0: Real-time Communication Between Browser
The definition of 'RTCPeerConnection.signalingState' in that specification.
|Working Draft||Initial specification.|
|Feature||Chrome||Firefox (Gecko)||Internet Explorer||Opera||Safari|
|Basic support||(Yes) ||22 (22) ||No support||(Yes)||?|
|Feature||Android||Chrome for Android||Firefox Mobile (Gecko)||IE Mobile||Opera Mobile||Safari Mobile|
|Basic support||?||?||22.0 (22) ||No support||?||?|
 Though this property is not prefixed, the
RTCPeerConnection interface it's a member of was until Firefox 44.
© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.