createOffer method

JSPromise<RTCSessionDescriptionInit?> createOffer([
  1. JSObject optionsOrSuccessCallback,
  2. RTCPeerConnectionErrorCallback failureCallback,
  3. RTCOfferOptions options
])

The createOffer() method of the RTCPeerConnection interface initiates the creation of an offer for the purpose of starting a new WebRTC connection to a remote peer.

The SDP offer includes information about any MediaStreamTrack objects already attached to the WebRTC session, codec, and options supported by the browser, and any candidates already gathered by the agent, for the purpose of being sent over the signaling channel to a potential peer to request a connection or to update the configuration of an existing connection.

The return value is a Promise which, when the offer has been created, is resolved with a RTCSessionDescriptionInit dictionary containing the newly-created offer.

Implementation

external JSPromise<RTCSessionDescriptionInit?> createOffer([
  JSObject optionsOrSuccessCallback,
  RTCPeerConnectionErrorCallback failureCallback,
  RTCOfferOptions options,
]);