A signalingstatechange
event is sent to an RTCPeerConnection
to notify it that its signaling state, as indicated by the signalingState
property, has changed.
This event is not cancelable and does not bubble.
A signalingstatechange
event is sent to an RTCPeerConnection
to notify it that its signaling state, as indicated by the signalingState
property, has changed.
This event is not cancelable and does not bubble.
Use the event name in methods like addEventListener()
, or set an event handler property.
js
addEventListener("signalingstatechange", (event) => {}); onsignalingstatechange = (event) => {};
A generic Event
.
Given an RTCPeerConnection
, pc
, and an updateStatus()
function that presents status information to the user, this code sets up an event handler to let the user know when the ICE negotiation process finishes up.
js
pc.addEventListener( "signalingstatechange", (ev) => { switch (pc.signalingState) { case "stable": updateStatus("ICE negotiation complete"); break; } }, false, );
Using onsignalingstatechange
, it looks like this:
js
pc.onsignalingstatechange = (ev) => { switch (pc.signalingState) { case "stable": updateStatus("ICE negotiation complete"); break; } };
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
signalingstatechange_event |
28 | 15 | 3624–36Although theonsignalingstatechange property is supported, the signalingstatechange event is not fired as an Event object. See bug 1075133. |
No | 15 | 11 | 4.4 | 28 | 3624–36Although theonsignalingstatechange property is supported, the signalingstatechange event is not fired as an Event object. See bug 1075133. |
15 | No | 1.5 |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/signalingstatechange_event