Firefox Tomorrow

web api event

RTCPeerConnection: signalingstatechange event

View on MDN ↗

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.

Syntax

Use the event name in methods like addEventListener(), or set an event handler property.

addEventListener("signalingstatechange", (event) => { })

onsignalingstatechange = (event) => { }

Event type

A generic Event.

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;
  }
});

Using onsignalingstatechange, it looks like this:

pc.onsignalingstatechange = (ev) => {
  switch (pc.signalingState) {
    case "stable":
      updateStatus("ICE negotiation complete");
      break;
  }
};

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also