RTCSessionDescription
The session description of one end of a connection.
- class webrtc.models.rtc_session_description.RTCSessionDescription(type, sdp='')
A session description set on a connection, with its SDP and its role in the offer/answer exchange.
webrtc.RTCPeerConnection.local_descriptionand the other description properties return it. The methods that set a description take anwebrtc.RTCSessionDescriptionInitas well, so creating one is rarely needed. The type is checked on creation, but the SDP is only parsed once the description is set. Both are writable; a description already set on a connection doesnβt change. See MDN: RTCSessionDescription.- Parameters:
type (
webrtc.RTCSdpType) β The type of the description, or its value (like'offer'). Anwebrtc.RTCSessionDescriptionInitis taken too, in which casesdpis ignored.sdp (
str, optional) β The SDP of the description, empty by default.
- Raises:
ValueError β If the type isnβt a member of
webrtc.RTCSdpType.
- to_json()
Returns the description as a JSON-serializable dictionary, to send to the remote peer.
webrtc.RTCSessionDescriptionInit.from_json()reads it back. See MDN: RTCSessionDescription/toJSON.
- property type: webrtc.RTCSdpType
The role of the description in the offer/answer exchange.
It can be set with a member or its value. See MDN: RTCSessionDescription/type.
- Type:
- property sdp: str
The SDP of the description, which may be empty (like for a
rollback).See MDN: RTCSessionDescription/sdp.
- Type: