webrtc package#
- class webrtc.CricketIceGatheringState(value: int)#
Bases:
object
Members:
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:
object
Members:
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.WebRTCObject
The 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.MediaStream
is 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.MediaStreamTrack
given as argument. If the track has already been added to thewebrtc.MediaStream
object, nothing happens.
- clone() webrtc.MediaStream #
Returns a clone of the
webrtc.MediaStream
object. 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
list
of thewebrtc.MediaStreamTrack
objects stored in thewebrtc.MediaStream
object 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
list
of allwebrtc.MediaStreamTrack
objects stored in thewebrtc.MediaStream
object, 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
list
of thewebrtc.MediaStreamTrack
objects stored in thewebrtc.MediaStream
object 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.MediaStreamTrack
given as argument. If the track is not part of thewebrtc.MediaStream
object, nothing happens.
- class webrtc.MediaStreamSourceState(value: int)#
Bases:
object
Members:
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.WebRTCObject
The 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:
object
Members:
live
ended
- ended: wrtc.MediaStreamTrackState#
- property name: str#
str
- Type
type
- property value: int#
int
- Type
type
- class webrtc.MediaType(value: int)#
Bases:
object
Members:
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.WebRTCObject
The
webrtc.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.- createTrack() webrtc.MediaStreamTrack #
Alias for
create_track
- create_track() webrtc.MediaStreamTrack #
Create
webrtc.MediaStreamTrack
whose source is thewebrtc.RTCAudioSource
.- Returns
A
webrtc.MediaStreamTrack
object 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.MediaStreamTrack
created withcreateTrack
.- Parameters
data (
webrtc.RTCOnDataEvent
) – Awebrtc.RTCOnDataEvent
object representing new audio samples.- Return type
None
- class webrtc.RTCDtlsTransport(native_obj=None)#
Bases:
webrtc.base.WebRTCObject
The
webrtc.RTCDtlsTransport
interface 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.RTCRtpSender
andwebrtc.RTCRtpReceiver
objects.- property iceTransport: webrtc.RTCIceTransport#
Alias for
ice_transport
- property ice_transport: webrtc.RTCIceTransport#
Returns a reference to the underlying
webrtc.RTCIceTransport
object.
- property state: webrtc.DtlsTransportState#
Returns a member of
webrtc.DtlsTransportState
which describes the underlying Datagram Transport Layer Security (DTLS) transport state.
- exception webrtc.RTCException#
Bases:
wrtc.PythonWebRTCExceptionBase
,Exception
,BaseException
- class webrtc.RTCIceComponent(value: int)#
Bases:
object
Members:
RTP
RTCP
- RTCP: wrtc.RTCIceComponent#
- property name: str#
str
- Type
type
- property value: int#
int
- Type
type
- class webrtc.RTCIceConnectionState(value: int)#
Bases:
object
Members:
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:
object
Members:
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:
object
Members:
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.WebRTCObject
The
webrtc.RTCIceTransport
interface 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.RTCIceComponent
enumerated type: “RTP” or “RTSP”.
- property gatheringState: webrtc.CricketIceGatheringState#
Alias for
gathering_state
- property gathering_state: webrtc.CricketIceGatheringState#
A member of
webrtc.CricketIceGatheringState
enum, 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.RTCIceTransportState
indicating 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:
object
Members:
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.WebRTCObject
Audio data samples representation.
Note
webrtc.RTCOnDataEvent
should 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.WebRTCObject
The 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.MediaStreamTrack
to the set of tracks which will be transmitted to the other peer.- Parameters
track (
webrtc.MediaStreamTrack
) – Awebrtc.MediaStreamTrack
object representing the media track to add to the peer connection.stream (
webrtc.MediaStream
orlist
ofwebrtc.MediaStream
, optional) – One or more localwebrtc.MediaStream
objects to which the track should be added.
- Returns
The
webrtc.RTCRtpSender
object 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.RTCRtpTransceiver
and adds it to the set of transceivers associated with the connection. Each transceiver represents a bidirectional stream, with both anwebrtc.RTCRtpSender
and anwebrtc.RTCRtpReceiver
associated with it.- Parameters
track_or_kind (
webrtc.MediaStreamTrack
) – Awebrtc.MediaStreamTrack
to associate with the transceiver, or a member ofwebrtc.MediaType
which is used as the kind of the receiver’s track, and by extension of thewebrtc.RTCRtpReceiver
itself.init (
webrtc.RtpTransceiverInit
, optional) – An object for specifying any options when creating the new transceiver.
- Returns
The
webrtc.RTCRtpSender
object 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.RTCRtpReceiver
objects, each of which represents one RTP receiver. Each RTP receiver manages the reception and decoding of data for awebrtc.MediaStreamTrack
on anwebrtc.RTCPeerConnection
.Note
The order of the returned
webrtc.RTCRtpReceiver
is not defined by the specification, and may change from one call toget_receivers
to the next.- Returns
- An array of
webrtc.RTCRtpReceiver
objects, 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
list
ofwebrtc.RTCRtpReceiver
- get_senders() List[webrtc.RTCRtpSender] #
Returns an array of
webrtc.RTCRtpSender
objects, 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.RTCRtpSenders
is not defined by the specification, and may change from one call toget_senders
to the next.- Returns
An array of
webrtc.RTCRtpSender
objects, one for each track on the connection. The array is empty if there are no RTP senders on the connection.- Return type
list
ofwebrtc.RTCRtpSender
- get_transceivers() List[webrtc.RTCRtpTransceiver] #
Returns a
list
of thewebrtc.RTCRtpTransceiver
objects being used to send and receive data on the connection.- Returns
An array of the
webrtc.RTCRtpTransceiver
objects 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
list
ofwebrtc.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.RTCRtpSender
from 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.RTCSessionDescription
object 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.RTCSessionDescription
object that describes one end of a connection or potential connection.- Return type
None
- class webrtc.RTCPeerConnectionState(value: int)#
Bases:
object
Members:
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.WebRTCObject
The
webrtc.RTCRtpReceiver
interface of the WebRTC API manages the reception and decoding of data for awebrtc.MediaStreamTrack
on anwebrtc.RTCPeerConnection
.- property track: webrtc.MediaStreamTrack#
The
webrtc.MediaStreamTrack
associated with the currentwebrtc.RTCRtpReceiver
instance.
- 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.WebRTCObject
The
webrtc.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.- property track: Optional[webrtc.MediaStreamTrack]#
The
webrtc.MediaStreamTrack
which is being handled by thewebrtc.RTCRtpSender
. If track isNone
, thewebrtc.RTCRtpSender
doesn’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.WebRTCObject
The WebRTC interface
webrtc.RTCRtpTransceiver
describes a permanent pairing of anwebrtc.RTCRtpSender
and 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.TransceiverDirection
enum, indicating the current directionality of the transceiver.
- property direction: webrtc.TransceiverDirection#
A member of
webrtc.TransceiverDirection
enum, indicating the transceiver’s preferred direction.Note
The transceiver’s current direction is indicated by the
currentDirection
property.
- property mid: Optional[str]#
A
str
which 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 isNone
if negotiation has not completed.
- property receiver: webrtc.RTCRtpReceiver#
A
webrtc.RTCRtpReceiver
object 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.RTCRtpSender
object 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.RTCRtpSender
andwebrtc.RTCRtpReceiver
.Note
The
stopped
property was provided to returnTrue
if 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.WebRTCObject
The
webrtc.RTCSctpTransport
interface 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.RTCDataChannel
that 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.send
method.- 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:
object
Members:
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.WebRTCObject
The
webrtc.RTCSessionDescription
interface describes one end of a connection or potential connection and how it’s configured. EachwebrtcRTCSessionDescription
consists 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.RTCSessionDescription
objects 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.RTCSessionDescriptionInit
is 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.RTCSessionDescription
yourself.Warning
Deprecated: Constructor with
webrtc.RTCSessionDescriptionInit
is 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.RTCSdpType
enum.- Type
- class webrtc.RTCSessionDescriptionInit(type: webrtc.RTCSdpType, sdp='')#
Bases:
webrtc.base.WebRTCObject
An 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.RTCSdpType
enum.- 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.WebRTCObject
Model 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_framerate
or 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.WebRTCObject
A 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.RTCRtpTransceiver
object’swebrtc.RTCRtpTransceiver.direction
property.
- 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
list
ofwebrtc.RtpEncodingParameters
- property streams: List[webrtc.MediaStream]#
A list of
webrtc.MediaStream
objects 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
list
ofwebrtc.MediaStream
- class webrtc.SctpTransportState(value: int)#
Bases:
object
Members:
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:
object
Members:
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.MediaStream
with tracks containing the requested types of media.- Returns
A
webrtc.MediaStream
object 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.MediaStream
with tracks containing the requested types of media.- Returns
A
webrtc.MediaStream
object 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