webrtc package#
- class webrtc.CricketIceGatheringState(value: int)#
Bases:
objectMembers:
new
gathering
complete
- complete: wrtc.CricketIceGatheringState#
- gathering: wrtc.CricketIceGatheringState#
- property name: str#
str
- Type
type
- property value: int#
int
- Type
type
- class webrtc.DtlsTransportState(value: int)#
Bases:
objectMembers:
new
connecting
connected
closed
failed
- closed: wrtc.DtlsTransportState#
- connected: wrtc.DtlsTransportState#
- connecting: wrtc.DtlsTransportState#
- failed: wrtc.DtlsTransportState#
- property name: str#
str
- Type
type
- property value: int#
int
- Type
type
- class webrtc.MediaStream(native_obj=None)#
Bases:
webrtc.base.WebRTCObjectThe MediaStream interface represents a stream of media content. A stream consists of several tracks, such as video or audio tracks. Each track is specified as an instance of
webrtc.MediaStreamTrack.- property active: bool#
A value that returns true if the
webrtc.MediaStreamis active, or false otherwise.- Type
bool
- addTrack(track: webrtc.MediaStreamTrack)#
Alias for
add_track
- add_track(track: webrtc.MediaStreamTrack)#
Stores a copy of the
webrtc.MediaStreamTrackgiven as argument. If the track has already been added to thewebrtc.MediaStreamobject, nothing happens.
- clone() webrtc.MediaStream#
Returns a clone of the
webrtc.MediaStreamobject. The clone will, however, have a unique value forid.
- getAudioTracks() List[webrtc.MediaStreamTrack]#
Alias for
get_audio_tracks
- getTrackById(track_id: str) Optional[webrtc.MediaStreamTrack]#
Alias for
get_track_by_id
- getTracks() List[webrtc.MediaStreamTrack]#
Alias for
get_tracks
- getVideoTracks() List[webrtc.MediaStreamTrack]#
Alias for
get_video_tracks
- get_audio_tracks() List[webrtc.MediaStreamTrack]#
Returns a
listof thewebrtc.MediaStreamTrackobjects stored in thewebrtc.MediaStreamobject that have their kind attribute set to “audio”. The order is not defined, and may not only vary from one machine to another, but also from one call to another.
- get_track_by_id(track_id: str) Optional[webrtc.MediaStreamTrack]#
Returns the track whose ID corresponds to the one given in parameters,
track_id. If no parameter is given, or if no track with that ID does exist, it returnsNone. If several tracks have the same ID, it returns the first one.
- get_tracks() List[webrtc.MediaStreamTrack]#
Returns a
listof allwebrtc.MediaStreamTrackobjects stored in thewebrtc.MediaStreamobject, regardless of the value of the kind attribute. The order is not defined, and may not only vary from one machine to another, but also from one call to another.
- get_video_tracks() List[webrtc.MediaStreamTrack]#
Returns a
listof thewebrtc.MediaStreamTrackobjects stored in thewebrtc.MediaStreamobject that have their kind attribute set to “video”. The order is not defined, and may not only vary from one machine to another, but also from one call to another.
- property id: str#
A String containing 36 characters denoting a universally unique identifier (UUID) for the object.
- Type
str
- removeTrack(track: webrtc.MediaStreamTrack)#
Alias for
remove_track
- remove_track(track: webrtc.MediaStreamTrack)#
Removes the
webrtc.MediaStreamTrackgiven as argument. If the track is not part of thewebrtc.MediaStreamobject, nothing happens.
- class webrtc.MediaStreamSourceState(value: int)#
Bases:
objectMembers:
initializing
live
ended
muted
- ended: wrtc.MediaStreamSourceState#
- initializing: wrtc.MediaStreamSourceState#
- muted: wrtc.MediaStreamSourceState#
- property name: str#
str
- Type
type
- property value: int#
int
- Type
type
- class webrtc.MediaStreamTrack(native_obj=None)#
Bases:
webrtc.base.WebRTCObjectThe MediaStreamTrack interface represents a single media track within a stream; typically, these are audio or video tracks, but other track types may exist as well.
- clone() webrtc.MediaStreamTrack#
Returns a duplicate of the
webrtc.MediaStreamTrack.
- property enabled: bool#
A Boolean whose value of true if the track is enabled, that is allowed to render the media source stream; or false if it is disabled, that is not rendering the media source stream but silence and blackness. If the track has been disconnected, this value can be changed but has no more effect.
- Type
bool
- property id: str#
A unique identifier (GUID) for the track.
- Type
bool
- property kind: webrtc.MediaType#
Indicating type of media. Audio or video. It doesn’t change if the track is deassociated from its source.
- Type
- property muted: bool#
A value indicating whether the track is unable to provide media data due to a technical issue.
- Type
bool
- property readyState: webrtc.MediaStreamTrackState#
Alias for
ready_state
- property ready_state: webrtc.MediaStreamTrackState#
Returns an enumerated value giving the status of the track.
- stop()#
Stops playing the source associated to the track, both the source and the track are deassociated. The track state is set to ended.
- class webrtc.MediaStreamTrackState(value: int)#
Bases:
objectMembers:
live
ended
- ended: wrtc.MediaStreamTrackState#
- property name: str#
str
- Type
type
- property value: int#
int
- Type
type
- class webrtc.MediaType(value: int)#
Bases:
objectMembers:
audio
video
data
unsupported
- audio: wrtc.MediaType#
- data: wrtc.MediaType#
- property name: str#
str
- Type
type
- unsupported: wrtc.MediaType#
- property value: int#
int
- Type
type
- video: wrtc.MediaType#
- exception webrtc.PythonWebRTCException#
Bases:
wrtc.PythonWebRTCExceptionBase,Exception,BaseException
- exception webrtc.PythonWebRTCExceptionBase#
Bases:
Exception,BaseException
- class webrtc.RTCAudioSource(native_obj=None)#
Bases:
webrtc.base.WebRTCObjectThe
webrtc.MediaStreamTrackinterface represents a single media track within a stream; typically, these are audio or video tracks, but other track types may exist as well.- createTrack() webrtc.MediaStreamTrack#
Alias for
create_track
- create_track() webrtc.MediaStreamTrack#
Create
webrtc.MediaStreamTrackwhose source is thewebrtc.RTCAudioSource.- Returns
A
webrtc.MediaStreamTrackobject representing the media track.- Return type
- onData(data: webrtc.RTCOnDataEvent)#
Alias for
on_data
- on_data(data: webrtc.RTCOnDataEvent)#
Push a new audio samples to every non-stopped local audio
webrtc.MediaStreamTrackcreated withcreateTrack.- Parameters
data (
webrtc.RTCOnDataEvent) – Awebrtc.RTCOnDataEventobject representing new audio samples.- Return type
None
- class webrtc.RTCDtlsTransport(native_obj=None)#
Bases:
webrtc.base.WebRTCObjectThe
webrtc.RTCDtlsTransportinterface provides access to information about the Datagram Transport Layer Security (DTLS) transport over which awebrtc.RTCPeerConnection’s RTP and RTCP packets are sent and received by itswebrtc.RTCRtpSenderandwebrtc.RTCRtpReceiverobjects.- property iceTransport: webrtc.RTCIceTransport#
Alias for
ice_transport
- property ice_transport: webrtc.RTCIceTransport#
Returns a reference to the underlying
webrtc.RTCIceTransportobject.
- property state: webrtc.DtlsTransportState#
Returns a member of
webrtc.DtlsTransportStatewhich describes the underlying Datagram Transport Layer Security (DTLS) transport state.
- exception webrtc.RTCException#
Bases:
wrtc.PythonWebRTCExceptionBase,Exception,BaseException
- class webrtc.RTCIceComponent(value: int)#
Bases:
objectMembers:
RTP
RTCP
- RTCP: wrtc.RTCIceComponent#
- property name: str#
str
- Type
type
- property value: int#
int
- Type
type
- class webrtc.RTCIceConnectionState(value: int)#
Bases:
objectMembers:
new
checking
connected
completed
failed
disconnected
closed
max
- checking: wrtc.RTCIceConnectionState#
- closed: wrtc.RTCIceConnectionState#
- completed: wrtc.RTCIceConnectionState#
- connected: wrtc.RTCIceConnectionState#
- disconnected: wrtc.RTCIceConnectionState#
- failed: wrtc.RTCIceConnectionState#
- property name: str#
str
- Type
type
- property value: int#
int
- Type
type
- class webrtc.RTCIceGatheringState(value: int)#
Bases:
objectMembers:
new
gathering
complete
- complete: wrtc.RTCIceGatheringState#
- gathering: wrtc.RTCIceGatheringState#
- property name: str#
str
- Type
type
- property value: int#
int
- Type
type
- class webrtc.RTCIceRole(value: int)#
Bases:
objectMembers:
controlling
controlled
unknown
- controlled: wrtc.RTCIceRole#
- controlling: wrtc.RTCIceRole#
- property name: str#
str
- Type
type
- unknown: wrtc.RTCIceRole#
- property value: int#
int
- Type
type
- class webrtc.RTCIceTransport(native_obj=None)#
Bases:
webrtc.base.WebRTCObjectThe
webrtc.RTCIceTransportinterface provides access to information about the ICE transport layer over which the data is being sent and received. This is particularly useful if you need to access state information about the connection.- property component: webrtc.RTCIceComponent#
The ICE component being used by the transport. The value is one of the strings from the
webrtc.RTCIceComponentenumerated type: “RTP” or “RTSP”.
- property gatheringState: webrtc.CricketIceGatheringState#
Alias for
gathering_state
- property gathering_state: webrtc.CricketIceGatheringState#
A member of
webrtc.CricketIceGatheringStateenum, indicating which current gathering state of the ICE agent
- property role: webrtc.RTCIceRole#
A member of
webrtc.RTCIceRole; this indicates whether the ICE agent is the one that makes the final decision as to the candidate pair to use or not.
- property state: webrtc.RTCIceTransportState#
A member of
webrtc.RTCIceTransportStateindicating what the current state of the ICE agent is.Note
For more details of values: https://developer.mozilla.org/en-US/docs/Web/API/RTCIceTransportState
- class webrtc.RTCIceTransportState(value: int)#
Bases:
objectMembers:
new
checking
connected
completed
disconnected
failed
closed
- checking: wrtc.RTCIceTransportState#
- closed: wrtc.RTCIceTransportState#
- completed: wrtc.RTCIceTransportState#
- connected: wrtc.RTCIceTransportState#
- disconnected: wrtc.RTCIceTransportState#
- failed: wrtc.RTCIceTransportState#
- property name: str#
str
- Type
type
- property value: int#
int
- Type
type
- class webrtc.RTCOnDataEvent(audio_data: AnyStr, number_of_frames: int)#
Bases:
webrtc.base.WebRTCObjectAudio data samples representation.
Note
webrtc.RTCOnDataEventshould represent 10 ms of audio samples.- property audioData: AnyStr#
Alias for
audio_data
- property audio_data: AnyStr#
An audio data.
- Type
AnyStr
- property bitsPerSample: int#
Alias for
bits_per_sample
- property bits_per_sample: int#
Bits per sample.
- Type
int
- property channelCount: int#
Alias for
channel_count
- property channel_count: int#
A channel count.
- Type
int
- property numberOfFrames: int#
Alias for
number_of_frames
- property number_of_frames: int#
A number of frames.
- Type
int
- property sampleRate: int#
Alias for
sample_rate
- property sample_rate: int#
A sample rate.
- Type
int
- class webrtc.RTCPeerConnection(native_obj=None)#
Bases:
webrtc.base.WebRTCObjectThe RTCPeerConnection interface represents a WebRTC connection between the local computer and a remote peer. It provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it’s no longer needed.
- addTrack(track: webrtc.MediaStreamTrack, stream: Optional[Union[webrtc.MediaStream, List[webrtc.MediaStream]]] = None) webrtc.RTCRtpSender#
Alias for
add_track
- addTransceiver(track_or_kind: Union[webrtc.MediaStreamTrack, webrtc.MediaType], init: Optional[webrtc.RtpTransceiverInit] = None) webrtc.RTCRtpTransceiver#
Alias for
add_transceiver
- add_track(track: webrtc.MediaStreamTrack, stream: Optional[Union[webrtc.MediaStream, List[webrtc.MediaStream]]] = None) webrtc.RTCRtpSender#
Adds a new
webrtc.MediaStreamTrackto the set of tracks which will be transmitted to the other peer.- Parameters
track (
webrtc.MediaStreamTrack) – Awebrtc.MediaStreamTrackobject representing the media track to add to the peer connection.stream (
webrtc.MediaStreamorlistofwebrtc.MediaStream, optional) – One or more localwebrtc.MediaStreamobjects to which the track should be added.
- Returns
The
webrtc.RTCRtpSenderobject which will be used to transmit the media data.- Return type
- add_transceiver(track_or_kind: Union[webrtc.MediaStreamTrack, webrtc.MediaType], init: Optional[webrtc.RtpTransceiverInit] = None) webrtc.RTCRtpTransceiver#
Creates a new
webrtc.RTCRtpTransceiverand adds it to the set of transceivers associated with the connection. Each transceiver represents a bidirectional stream, with both anwebrtc.RTCRtpSenderand anwebrtc.RTCRtpReceiverassociated with it.- Parameters
track_or_kind (
webrtc.MediaStreamTrack) – Awebrtc.MediaStreamTrackto associate with the transceiver, or a member ofwebrtc.MediaTypewhich is used as the kind of the receiver’s track, and by extension of thewebrtc.RTCRtpReceiveritself.init (
webrtc.RtpTransceiverInit, optional) – An object for specifying any options when creating the new transceiver.
- Returns
The
webrtc.RTCRtpSenderobject which will be used to transmit the media data.- Return type
- close()#
Closes the current peer connection.
- async createAnswer() webrtc.RTCSessionDescription#
Alias for
create_answer
- async createOffer() webrtc.RTCSessionDescription#
Alias for
create_offer
- async create_answer() webrtc.RTCSessionDescription#
Initiates the creation an SDP answer to an offer received from a remote peer during the offer/answer negotiation of a WebRTC connection. The answer contains information about any media already attached to the session, codecs and options supported by the machine, and any ICE candidates already gathered.
- async create_offer() webrtc.RTCSessionDescription#
Initiates the creation of an SDP 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 machine, as well as any candidates already gathered by the ICE 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.
- getReceivers() List[webrtc.RTCRtpReceiver]#
Alias for
get_receivers
- getSenders() List[webrtc.RTCRtpSender]#
Alias for
get_senders
- getTransceivers() List[webrtc.RTCRtpTransceiver]#
Alias for
get_transceivers
- get_receivers() List[webrtc.RTCRtpReceiver]#
Returns an array of
webrtc.RTCRtpReceiverobjects, each of which represents one RTP receiver. Each RTP receiver manages the reception and decoding of data for awebrtc.MediaStreamTrackon anwebrtc.RTCPeerConnection.Note
The order of the returned
webrtc.RTCRtpReceiveris not defined by the specification, and may change from one call toget_receiversto the next.- Returns
- An array of
webrtc.RTCRtpReceiverobjects, one for each track on the connection. The array is empty if there are no RTP receivers on the connection.
- An array of
- Return type
listofwebrtc.RTCRtpReceiver
- get_senders() List[webrtc.RTCRtpSender]#
Returns an array of
webrtc.RTCRtpSenderobjects, each of which represents the RTP sender responsible for transmitting one track’s data. A sender object provides methods and properties for examining and controlling the encoding and transmission of the track’s data.Note
The order of the returned
webrtc.RTCRtpSendersis not defined by the specification, and may change from one call toget_sendersto the next.- Returns
An array of
webrtc.RTCRtpSenderobjects, one for each track on the connection. The array is empty if there are no RTP senders on the connection.- Return type
listofwebrtc.RTCRtpSender
- get_transceivers() List[webrtc.RTCRtpTransceiver]#
Returns a
listof thewebrtc.RTCRtpTransceiverobjects being used to send and receive data on the connection.- Returns
An array of the
webrtc.RTCRtpTransceiverobjects representing the transceivers handling sending and receiving all media on thewebrtc.RTCPeerConnection. The list is in the order in which the transceivers were added to the connection.- Return type
listofwebrtc.RTCRtpTransceiver
- removeTrack(sender: webrtc.RTCRtpSender) None#
Alias for
remove_track
- remove_track(sender: webrtc.RTCRtpSender) None#
Tells the local end of the connection to stop sending media from the specified track, without actually removing the corresponding
webrtc.RTCRtpSenderfrom the list of senders as reported byget_senders`. If the track is already stopped, or is not in the connection’s senders list, this method has no effect.
- restartIce() None#
Alias for
restart_ice
- restart_ice() None#
Allows to easily request that ICE candidate gathering be redone on both ends of the connection. This simplifies the process by allowing the same method to be used by either the caller or the receiver to trigger an ICE restart.
- property sctp: Optional[webrtc.RTCSctpTransport]#
An object describing the SCTP transport layer over which SCTP data is being sent and received. If SCTP hasn’t been negotiated, this value is
None- Type
webrtc.RTCSctpTransport, optional
- async setLocalDescription(sdp: webrtc.RTCSessionDescription)#
Alias for
set_local_description
- async setRemoteDescription(sdp: webrtc.RTCSessionDescription)#
Alias for
set_remote_description
- async set_local_description(sdp: webrtc.RTCSessionDescription)#
Changes the local description associated with the connection. This description specifies the properties of the local end of the connection, including the media format. It returns a
Coroutine. A result will be returned once the description has been changed, asynchronously.- Parameters
sdp (
webrtc.RTCSessionDescription) – Awebrtc.RTCSessionDescriptionobject that describes one end of a connection or potential connection.- Return type
None
- async set_remote_description(sdp: webrtc.RTCSessionDescription)#
Sets the specified session description as the remote peer’s current offer or answer. The description specifies the properties of the remote end of the connection, including the media format. It returns a
Coroutine. A result will be returned once the description has been changed, asynchronously.- Parameters
sdp (
webrtc.RTCSessionDescription) – Awebrtc.RTCSessionDescriptionobject that describes one end of a connection or potential connection.- Return type
None
- class webrtc.RTCPeerConnectionState(value: int)#
Bases:
objectMembers:
new
connecting
connected
disconnected
failed
closed
- closed: wrtc.RTCPeerConnectionState#
- connected: wrtc.RTCPeerConnectionState#
- connecting: wrtc.RTCPeerConnectionState#
- disconnected: wrtc.RTCPeerConnectionState#
- failed: wrtc.RTCPeerConnectionState#
- property name: str#
str
- Type
type
- property value: int#
int
- Type
type
- class webrtc.RTCRtpReceiver(native_obj=None)#
Bases:
webrtc.base.WebRTCObjectThe
webrtc.RTCRtpReceiverinterface of the WebRTC API manages the reception and decoding of data for awebrtc.MediaStreamTrackon anwebrtc.RTCPeerConnection.- property track: webrtc.MediaStreamTrack#
The
webrtc.MediaStreamTrackassociated with the currentwebrtc.RTCRtpReceiverinstance.
- property transport: Optional[webrtc.RTCDtlsTransport]#
An object representing the underlying transport being used by the receiver to exchange packets with the remote peer, or null if the receiver isn’t yet connected to transport.
- class webrtc.RTCRtpSender(native_obj=None)#
Bases:
webrtc.base.WebRTCObjectThe
webrtc.MediaStreamTrackinterface represents a single media track within a stream; typically, these are audio or video tracks, but other track types may exist as well.- property track: Optional[webrtc.MediaStreamTrack]#
The
webrtc.MediaStreamTrackwhich is being handled by thewebrtc.RTCRtpSender. If track isNone, thewebrtc.RTCRtpSenderdoesn’t transmit anything.- Type
webrtc.MediaStreamTrack, optional
- property transport: Optional[webrtc.RTCDtlsTransport]#
An object representing the underlying transport being used by the sender to exchange packets with the remote peer, or null if the sender isn’t yet connected to transport.
- class webrtc.RTCRtpTransceiver(native_obj=None)#
Bases:
webrtc.base.WebRTCObjectThe WebRTC interface
webrtc.RTCRtpTransceiverdescribes a permanent pairing of anwebrtc.RTCRtpSenderand anwebrtc.RTCRtpReceiver, along with some shared state.- property currentDirection: Optional[webrtc.TransceiverDirection]#
Alias for
current_direction
- property current_direction: Optional[webrtc.TransceiverDirection]#
A member of
webrtc.TransceiverDirectionenum, indicating the current directionality of the transceiver.
- property direction: webrtc.TransceiverDirection#
A member of
webrtc.TransceiverDirectionenum, indicating the transceiver’s preferred direction.Note
The transceiver’s current direction is indicated by the
currentDirectionproperty.
- property mid: Optional[str]#
A
strwhich uniquely identifies the pairing of source and destination of the transceiver’s stream. Its value is taken from the media ID of the SDP m-line. This value isNoneif negotiation has not completed.
- property receiver: webrtc.RTCRtpReceiver#
A
webrtc.RTCRtpReceiverobject which is responsible for receiving and decoding incoming media data whose media ID is the same as the current value ofmid.
- property sender: webrtc.RTCRtpSender#
A
webrtc.RTCRtpSenderobject used to encode and send media whose media ID matches the current value ofmid.
- stop() None#
Permanently stops the transceiver by stopping both the associated
webrtc.RTCRtpSenderandwebrtc.RTCRtpReceiver.Note
The
stoppedproperty was provided to returnTrueif the connection is stopped. That property has been deprecated and will be removed at some point. Instead, check the value ofcurrentDirection. If it’swebrtc.TransceiverDirection.stopped, the transceiver has been stopped.
- class webrtc.RTCSctpTransport(native_obj=None)#
Bases:
webrtc.base.WebRTCObjectThe
webrtc.RTCSctpTransportinterface provides information which describes a Stream Control Transmission Protocol (SCTP) transport. This provides information about limitations of the transport, but also provides a way to access the underlying Datagram Transport Layer Security (DTLS) transport over which SCTP packets for all of anwebrtc.RTCPeerConnection’s data channels are sent and received.- property maxChannels: Optional[int]#
Alias for
max_channels
- property maxMessageSize: Optional[float]#
Alias for
max_message_size
- property max_channels: Optional[int]#
An integer value indicating the maximum number of
webrtc.RTCDataChannelthat can be open simultaneously.- Type
int, optional
- property max_message_size: Optional[float]#
An integer value indicating the maximum size, in bytes, of a message which can be sent using the
webrtc.RTCDataChannel.sendmethod.- Type
float, optional
- property state: webrtc.SctpTransportState#
A enumerated value indicating the state of the SCTP transport.
- property transport: webrtc.RTCDtlsTransport#
An object representing the DTLS transport used for the transmission and receipt of data packets.
- class webrtc.RTCSdpType(value: int)#
Bases:
objectMembers:
offer
pranswer
answer
rollback
- answer: wrtc.RTCSdpType#
- property name: str#
str
- Type
type
- offer: wrtc.RTCSdpType#
- pranswer: wrtc.RTCSdpType#
- rollback: wrtc.RTCSdpType#
- property value: int#
int
- Type
type
- class webrtc.RTCSessionDescription(rtc_session_description_init: webrtc.RTCSessionDescriptionInit)#
Bases:
webrtc.base.WebRTCObjectThe
webrtc.RTCSessionDescriptioninterface describes one end of a connection or potential connection and how it’s configured. EachwebrtcRTCSessionDescriptionconsists of a description type indicating which part of the offer/answer negotiation process it describes and of the SDP descriptor of the session.The process of negotiating a connection between two peers involves exchanging
webrtc.RTCSessionDescriptionobjects back and forth, with each description suggesting one combination of connection configuration options that the sender of the description supports. Once the two peers agree upon a configuration for the connection, negotiation is complete.Note
Note: Constructor with
webrtc.RTCSessionDescriptionInitis no longer necessary, however;RTCPeerConnection.setLocalDescription()and other methods which take SDP as input now directly accept an object conforming to the :obj:webrtc.RTCSessionDescriptionInit` object, so you don’t have to instantiate anwebrtc.RTCSessionDescriptionyourself.Warning
Deprecated: Constructor with
webrtc.RTCSessionDescriptionInitis no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes.- property sdp#
A string containing a SDP message describing the session.
- Type
str
- property type: webrtc.RTCSdpType#
A member of the
webrtc.RTCSdpTypeenum.- Type
- class webrtc.RTCSessionDescriptionInit(type: webrtc.RTCSdpType, sdp='')#
Bases:
webrtc.base.WebRTCObjectAn object providing the default values for the session description.
- property sdp: str#
A string containing a SDP message describing the session. This value is an empty string (‘’) by default and may not be None.
- Type
str
- property type: webrtc.RTCSdpType#
A member of the
webrtc.RTCSdpTypeenum.- Type
- class webrtc.RtpEncodingParameters(active: Optional[bool] = True, max_bitrate: Optional[int] = None, max_framerate: Optional[float] = None, rid: Optional[str] = None, scale_resolution_down_by: Optional[float] = None)#
Bases:
webrtc.base.WebRTCObjectModel describes a single configuration of a codec for an
webrtc.RTCRtpSender.- property active: bool#
If true, the described encoding is currently actively being used. That is, for RTP senders, the encoding is currently being used to send data, while for receivers, the encoding is being used to decode received data. The default value is true.
- Type
bool
- property maxBitrate: Optional[int]#
Alias for
max_bitrate
- property maxFramerate: Optional[int]#
Alias for
max_framerate
- property max_bitrate: Optional[int]#
An unsigned long integer indicating the maximum number of bits per second to allow for this encoding. Other parameters may further constrain the bit rate, such as the value of
max_framerateor transport or physical network limitations.- Type
int, optional
- property max_framerate: Optional[int]#
A double-precision floating-point value specifying the maximum number of frames per second to allow for this encoding.
- Type
int, optional
- property rid: Optional[str]#
A string which, if set, specifies an RTP stream ID (RID) to be sent using the RID header extension. This parameter cannot be modified using
webrtc.RTCRtpSender.set_parameters. Its value can only be set when the transceiver is first created.- Type
str, optional
- property scaleResolutionDownBy: Optional[float]#
Alias for
scale_resolution_down_by
- property scale_resolution_down_by: Optional[float]#
Only used for senders whose track’s kind is video, this is a double-precision floating-point value specifying a factor by which to scale down the video during encoding. The default value, 1.0, means that the sent video’s size will be the same as the original. A value of 2.0 scales the video frames down by a factor of 2 in each dimension, resulting in a video 1/4 the size of the original. The value must not be less than 1.0 (you can’t use this to scale the video up).
- Type
float, optional
- class webrtc.RtpTransceiverInit(direction: Optional[webrtc.RtpTransceiverDirection] = None, send_encodings: Optional[List[webrtc.RtpEncodingParameters]] = None, streams: Optional[List[webrtc.MediaStream]] = None)#
Bases:
webrtc.base.WebRTCObjectA model for specifying any options when creating the new transceiver.
- property direction: webrtc.TransceiverDirection#
The new transceiver’s preferred directionality. This value is used to initialize the new
webrtc.RTCRtpTransceiverobject’swebrtc.RTCRtpTransceiver.directionproperty.
- property sendEncodings: List[webrtc.RtpEncodingParameters]#
Alias for
send_encodings
- property send_encodings: List[webrtc.RtpEncodingParameters]#
A list of encodings to allow when sending RTP media from the
webrtc.RTCRtpSender. Each entry is of typewebrtc.RtpEncodingParameters.- Type
listofwebrtc.RtpEncodingParameters
- property streams: List[webrtc.MediaStream]#
A list of
webrtc.MediaStreamobjects to add to the transceiver’swebrtc.RTCRtpReceiver; when the remote peer’swebrtc.RTCPeerConnection’s track event occurs, these are the streams that will be specified by that event.- Type
listofwebrtc.MediaStream
- class webrtc.SctpTransportState(value: int)#
Bases:
objectMembers:
new
connecting
connected
closed
- closed: wrtc.SctpTransportState#
- connected: wrtc.SctpTransportState#
- connecting: wrtc.SctpTransportState#
- property name: str#
str
- Type
type
- property value: int#
int
- Type
type
- exception webrtc.SdpParseException#
Bases:
wrtc.PythonWebRTCExceptionBase,Exception,BaseException
- class webrtc.TransceiverDirection(value: int)#
Bases:
objectMembers:
sendrecv
sendonly
recvonly
inactive
stopped
- inactive: wrtc.TransceiverDirection#
- property name: str#
str
- Type
type
- recvonly: wrtc.TransceiverDirection#
- sendonly: wrtc.TransceiverDirection#
- sendrecv: wrtc.TransceiverDirection#
- stopped: wrtc.TransceiverDirection#
- property value: int#
int
- Type
type
- class webrtc.WebRTCObject(native_obj=None)#
Bases:
object
- webrtc.getUserMedia(constraints=None) webrtc.MediaStream#
Method prompts the user for permission to use a media input which produces a
webrtc.MediaStreamwith tracks containing the requested types of media.- Returns
A
webrtc.MediaStreamobject representing the media stream.- Return type
- webrtc.get_user_media(constraints=None) webrtc.MediaStream#
Method prompts the user for permission to use a media input which produces a
webrtc.MediaStreamwith tracks containing the requested types of media.- Returns
A
webrtc.MediaStreamobject representing the media stream.- Return type
Subpackages#
- webrtc.functions package
- webrtc.interfaces package
- Submodules
- webrtc.interfaces.media_stream
- webrtc.interfaces.media_stream_track
- webrtc.interfaces.rtc_audio_source
- webrtc.interfaces.rtc_dtls_transport
- webrtc.interfaces.rtc_ice_transport
- webrtc.interfaces.rtc_peer_connection
- webrtc.interfaces.rtc_rtp_receiver
- webrtc.interfaces.rtc_rtp_sender
- webrtc.interfaces.rtc_rtp_transceiver
- webrtc.interfaces.rtc_sctp_transport
- Submodules
- webrtc.models package