RTCPeerConnection: signalingstatechange event
An signalingstatechange
event is sent to an RTCPeerConnection
to notify it that its signaling state, as indicated by the signalingState
property, has changed.
Bubbles | No |
---|---|
Cancelable | No |
Interface | Event |
Event handler property | RTCPeerConnection.onsignalingstatechange |
Examples
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.
pc.addEventListener("signalingstatechange", ev => { switch(pc.signalingState) { case "stable": updateStatus("ICE negotiation complete"); break; } }, false);
Using onsignalingstatechange
, it looks like this:
pc.onsignalingstatechange = ev => { switch(pc.signalingState) { case "stable": updateStatus("ICE negotiation complete"); break; } };
Specifications
Specification |
---|
WebRTC 1.0: Real-Time Communication Between Browsers (WebRTC 1.0) # event-signalingstatechange |
Browser compatibility
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 |
22 |
No |
15 |
11 |
≤37 |
28 |
44 |
15 |
No |
1.5 |
See also
© 2005–2021 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