RTCSessionDescriptionInit

Session descriptions as plain data, to set on a connection or to exchange with the remote peer.

class webrtc.models.rtc_session_description_init.RTCSessionDescriptionInit(type, sdp='')

The type and the SDP of a session description, as plain data.

webrtc.RTCPeerConnection.create_offer() and webrtc.RTCPeerConnection.create_answer() return it, and the methods that set a description take it. from_json() creates it from a message of the remote peer. See MDN: RTCSessionDescription/RTCSessionDescription.

Parameters:
  • type (webrtc.RTCSdpType) – The type of the description, or its value (like 'offer').

  • sdp (str, optional) – The SDP of the description, empty by default.

Raises:
class webrtc.models.rtc_session_description_init.RTCLocalSessionDescriptionInit(type=None, sdp='')

A description for webrtc.RTCPeerConnection.set_local_description(), whose type may be left out.

Without an SDP, the connection creates and sets the description itself. It uses the given type, or else the offer or answer that its signaling state calls for. See MDN: RTCPeerConnection/setLocalDescription.

Parameters:
  • type (webrtc.RTCSdpType, optional) – The type of the description, or its value (like 'offer'). Required when an SDP is given.

  • sdp (str, optional) – The SDP of the description, empty by default.

Raises: