web api interface
RTCRtpSender
The RTCRtpSender interface provides the ability to control and obtain details about how a particular MediaStreamTrack is encoded and sent to a remote peer.
With it, you can configure the encoding used for the corresponding track, get information about the device’s media capabilities, and so forth. You can also obtain access to an RTCDTMFSender which can be used to send DTMF codes (to simulate the user pressing buttons on a telephone’s dial pad) to the remote peer.
Instance properties
dtmfRead only- : An
RTCDTMFSenderwhich can be used to send DTMF tones usingtelephone-eventpayloads on the RTP session represented by theRTCRtpSenderobject. Ifnull, the track and/or the connection doesn’t support DTMF. Only audio tracks can support DTMF.
- : An
trackRead only- : The
MediaStreamTrackwhich is being handled by theRTCRtpSender. Iftrackisnull, theRTCRtpSenderdoesn’t transmit anything.
- : The
transportRead only- : The
RTCDtlsTransportover which the sender is exchanging the RTP and RTCP packets used to manage transmission of media and control data. This value isnulluntil the transport is established. When bundling is in use, more than transceiver may be sharing the same transport object.
- : The
transform- : An
RTCRtpScriptTransformis used to insert a transform stream (TransformStream) running in a worker thread into the sender pipeline, allowing stream transforms to be applied to encoded video and audio frames after they are output by a codec, and before they are sent.
- : An
Obsolete properties
rtcpTransportDeprecated- : This property has been removed; the RTP and RTCP transports have been combined into a single transport. Use the
transportproperty instead.
- : This property has been removed; the RTP and RTCP transports have been combined into a single transport. Use the
Static methods
RTCRtpSender.getCapabilities()- : Returns an object describing the system’s capabilities for sending a specified kind of media data.
Instance methods
getParameters()- : Returns an object describing the current configuration for the encoding and transmission of media on the
track.
- : Returns an object describing the current configuration for the encoding and transmission of media on the
getStats()- : Returns a
Promisewhich is fulfilled with aRTCStatsReportwhich provides statistics data for all outbound streams being sent using thisRTCRtpSender.
- : Returns a
setParameters()- : Applies changes to parameters which configure how the
trackis encoded and transmitted to the remote peer.
- : Applies changes to parameters which configure how the
setStreams()replaceTrack()- : Attempts to replace the track currently being sent by the
RTCRtpSenderwith another track, without performing renegotiation. This method can be used, for example, to toggle between the front- and rear-facing cameras on a device.
- : Attempts to replace the track currently being sent by the
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.
See also
- WebRTC API
addTrack()getSenders()RTCRtpReceiver