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.

The RTCPeerConnection.onsignalingstatechange property is an EventHandler which specifies a function to be called when the signalingstatechange event occurs on an RTCPeerConnection interface. The function receives as input the event object, of type Event; this event is sent when the value of RTCPeerConnection.signalingState changes, as the result of a call to either setLocalDescription() or setRemoteDescription().


RTCPeerConnection.onsignalingstatechange = errorHandler;


Set this to a function which you provide that receives an Event object as input; this contains the signalingstatechange event. This event object doesn't provide details about what changed, but you can examine the signalingState property to determine what the new state is.


pc.onsignalingstatechange = function(event) {
  if (pc.signalingState === "have-local-pranswer") {
    // setLocalDescription() has been called with an answer


Specification Status Comment
WebRTC 1.0: Real-time Communication Between Browser
The definition of 'RTCPeerConnection.onsignalingstatechange' in that specification.
Working Draft Initial specification.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support (Yes) 24 (24)[1]
36.0 (36.0)[2]
No support (Yes) ?
Feature Android Chrome for Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support ? ? 24 (24)[1]
36.0 (36.0)[2]
No support ? ?

[1] Though this property isn't prefixed, the RTCPeerConnection interface of which it's a member was prefixed (as MozRTCPeerConnection) until Firefox 44.

[2] Before Firefox 36, the event handler was passed the signaling state value (one of the values in the RTCSignalingState enum) instead of the event as required by the specification. This has been fixed.

See also


© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.

Event Handler Experimental onsignalingstatechange Property Reference RTCPeerConnection WebRTC