RTCRtpReceiver
The receiver that receives and decodes remote media.
- class webrtc.interfaces.rtc_rtp_receiver.RTCRtpReceiver(native_obj=None)
Receives and decodes remote media into a
webrtc.MediaStreamTrack.Each
webrtc.RTCRtpTransceiverof anwebrtc.RTCPeerConnectionhas one.See MDN: RTCRtpReceiver.
- property track: MediaStreamTrack
The track the received media plays on. It exists from the start.
See MDN: RTCRtpReceiver/track.
- Type:
- property transport: RTCDtlsTransport | None
The transport the packets come over.
Itβs
Noneuntil thereβs one. See MDN: RTCRtpReceiver/transport.- Type:
webrtc.RTCDtlsTransport, optional
- property transform: RTCRtpScriptTransform | RTCRtpSFrameDecryptor | None
The frame transform.
It changes the encoded frames before theyβre decoded. With
None, frames are decoded as received. A transform serves one sender or receiver for its lifetime, so once attached it canβt be set elsewhere.See MDN: RTCRtpReceiver/transform.
- Raises:
TypeError β If the value set isnβt a transform of a receiver.
webrtc.InvalidStateError β If the transform set had a sender or receiver.
- Type:
webrtc.RTCRtpScriptTransformorwebrtc.RTCRtpSFrameDecryptor, optional
- property jitter_buffer_target: float | None
The target delay of the jitter buffer in milliseconds, from 0 to 4000.
A higher value adds latency for smoother playback.
Noneleaves it to the receiver.See MDN: RTCRtpReceiver/jitterBufferTarget.
- Raises:
TypeError β If the value set is NaN or infinite.
webrtc.InvalidRangeError β If the value set is outside 0 to 4000.
- Type:
float, optional
- get_parameters()
Returns the parameters the receiver receives with.
See MDN: RTCRtpReceiver/getParameters.
- Returns:
webrtc.RTCRtpReceiveParametersβ The parameters.- Return type:
- static get_capabilities(kind)
Returns the codecs and header extensions receivers of a kind support.
See MDN: RTCRtpReceiver/getCapabilities_static.
- Parameters:
kind (
webrtc.MediaType) β Audio or video.- Returns:
webrtc.RTCRtpCapabilities, optional β The capabilities, orNonefor another kind.- Return type:
RTCRtpCapabilities | None
- async get_stats()
Collects the stats of the receiver and of the objects they refer to.
See MDN: RTCRtpReceiver/getStats.
- Returns:
webrtc.RTCStatsReportβ The stats.- Raises:
webrtc.InvalidStateError β If the connection is closed.
- Return type:
- get_synchronization_sources()
Returns the synchronization sources (SSRCs) of the media received in the last 10 seconds.
See MDN: RTCRtpReceiver/getSynchronizationSources.
- Returns:
listofwebrtc.RTCRtpSynchronizationSourceβ The sources, the most recent first.- Return type:
- get_contributing_sources()
Returns the contributing sources (CSRCs) of the media received in the last 10 seconds.
These are the original streams a mixer, like a conference server, combined into the received one.
See MDN: RTCRtpReceiver/getContributingSources.
- Returns:
listofwebrtc.RTCRtpContributingSourceβ The sources, the most recent first.- Return type: