RTCPeerConnection: pendingLocalDescription property
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.
ThependingLocalDescription read-only property of theRTCPeerConnection interface returns anRTCSessionDescription object describing a pending configuration change for the local end of the connection.
This does not describe the connection as it currently stands, but as it may exist in the near future.UseRTCPeerConnection.currentLocalDescription orRTCPeerConnection.localDescription to get the current state of the endpoint.For details on the difference, seePending and current descriptions in the WebRTC Connectivity page.
In this article
Value
If a local description change is in progress, this is anRTCSessionDescription describing the proposed configuration.Otherwise, this returnsnull.
Examples
This example looks at thependingLocalDescription to determine whether or not there's a description change being processed.
const pc = new RTCPeerConnection();// …const sd = pc.pendingLocalDescription;if (sd) { // There's a description change underway!} else { // No description change pending}Specifications
| Specification |
|---|
| WebRTC: Real-Time Communication in Browsers> # dom-peerconnection-pendinglocaldesc> |
Browser compatibility
Note:The addition ofpendingLocalDescription andcurrentLocalDescription to the WebRTC spec is relatively recent.In browsers which don't support them, onlylocalDescription is available.