Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. RTCPeerConnection
  4. localDescription

RTCPeerConnection: localDescription property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨September 2017⁩.

ThelocalDescription read-only property of theRTCPeerConnection interface returns anRTCSessionDescription describing the session for the local end of the connection.If it has not yet been set, this isnull.

Value

On a more fundamental level, the returned value is the value ofRTCPeerConnection.pendingLocalDescription if that property isn'tnull;otherwise, the value ofRTCPeerConnection.currentLocalDescription is returned.SeePending and current descriptions in the WebRTC Connectivity page for details on this algorithm and why it's used.

Example

This example looks at thelocalDescription and displays an alert containing theRTCSessionDescription object'stype andsdp fields.

js
const pc = new RTCPeerConnection();// …const sd = pc.localDescription;if (sd) {  alert(`Local session: type='${sd.type}'; sdp description='${sd.sdp}'`);} else {  alert("No local session yet.");}

Specifications

Specification
WebRTC: Real-Time Communication in Browsers
# dom-peerconnection-localdescription

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp