4.6 Session Description Model
4.6.1 RTCSdpType
The RTCSdpType
enum describes the type of an RTCSessionDescriptionInit
, RTCLocalSessionDescriptionInit
, or RTCSessionDescription
instance.
Enumeration description | |
---|---|
offer | An |
pranswer | An |
answer | An |
rollback | An |
4.6.2 RTCSessionDescription
Class
The RTCSessionDescription
class is used by RTCPeerConnection
to expose local and remote session descriptions.
- WebIDL[Exposed=Window]
- interface
RTCSessionDescription
{constructor
(RTCSessionDescriptionInit
descriptionInitDict);- readonly attribute
RTCSdpType
type
;- readonly attribute DOMString
sdp
;- [Default] object
toJSON
();- };
Constructors
constructor()
The RTCSessionDescription()
constructor takes a dictionary argument, description, whose content is used to initialize the new RTCSessionDescription
object. This constructor is deprecated; it exists for legacy compatibility reasons only.
Attributes
type
of type RTCSdpType
, readonly
The type of this session description.
sdp
of type DOMString, readonly, defaulting to ""
The string representation of the SDP [SDP].
Methods
toJSON()
When called, run [WEBIDL]‘s default toJSON steps.
- WebIDLdictionary
RTCSessionDescriptionInit
{- required
RTCSdpType
type
;- DOMString
sdp
= "";- };
Dictionary RTCSessionDescriptionInit
Members
type
of type RTCSdpType
, required
The type of this session description.
sdp
of type DOMString
The string representation of the SDP [SDP]; if type
is “rollback
“, this member is unused.
- WebIDLdictionary
RTCLocalSessionDescriptionInit
{RTCSdpType
type
;- DOMString
sdp
= "";- };
Dictionary RTCLocalSessionDescriptionInit
Members
type
of type RTCSdpType
The type of this description. If not present, then setLocalDescription
will infer the type based on the RTCPeerConnection
‘s signaling state.
sdp
of type DOMString
The string representation of the SDP [SDP]; if type
is “rollback
“, this member is unused.