← Back to release summary

RTCPeerConnection.setLocalDescription() that implicitly creates the offer or answer

Category
Miscellaneous
Type
New or changed feature
Status
Enabled by default (Chrome 80)
Intent stage
Shipped

WPT details: This will be added as part of development

Summary

Makes the RTCSessionDescription argument optional for setLocalDescription(). Previously, it required a value returned by createOffer() or createAnswer(). With this change Chromium generates the the offer or answer implicitly when no argument is provided. This avoids possible edge-case races.

Motivation

This is part of "Perfect Negotiation", which makes signaling in WebRTC race-free and less error-prone. For more details, see https://docs.google.com/presentation/d/1xcvf0udNeSH7s1FOY7RRqr1dEFvokZjn-MZPjwy3iXQ/edit?usp=sharing.

Standards & signals

Ecosystem

Explainers: https://docs.google.com/presentation/d/1xcvf0udNeSH7s1FOY7RRqr1dEFvokZjn-MZPjwy3iXQ/edit?usp=sharing

View on chromestatus.com