setLocalDescription method
- RTCLocalSessionDescriptionInit description,
- VoidFunction successCallback,
- RTCPeerConnectionErrorCallback failureCallback
The setLocalDescription()
method of the RTCPeerConnection
interface changes the local description associated with the connection.
This description specifies the properties of the local end of the
connection, including the media format.
The method takes a single parameter—the session description—and it returns
a Promise
which is fulfilled once the description has been changed,
asynchronously.
If setLocalDescription()
is called while a connection is already in
place, it means renegotiation is underway (possibly to adapt to changing
network conditions).
Because descriptions will be exchanged until the two peers agree on a
configuration, the description submitted by calling
setLocalDescription()
does not immediately take effect.
Instead, the current connection configuration remains in place until
negotiation is complete. Only then does the agreed-upon configuration take
effect.
Implementation
external JSPromise<JSAny?> setLocalDescription([
RTCLocalSessionDescriptionInit description,
VoidFunction successCallback,
RTCPeerConnectionErrorCallback failureCallback,
]);