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.

Properties

RTCRtpSender.dtmf Read only
An RTCDTMFSender which can be used to send DTMF tones using telephone-event payloads on the RTP session represented by the RTCRtpSender object. If null, the track and/or the connection doesn't support DTMF. Only audio tracks can support DTMF.
RTCRtpSender.track Read only
The MediaStreamTrack which is being handled by the RTCRtpSender. If track is null, the RTCRtpSender doesn't transmit anything.
RTCRtpSender.transport Read only
The RTCDtlsTransport over which the sender is exchanging the RTP and RTCP packets used to manage transmission of media and control data. This value is null until the transport is established. When bundling is in use, more than transceiver may be sharing the same transport object.

Obsolete properties

rtcpTransport
This property has been removed; the RTP and RTCP transports have been combined into a single transport. Use the transport property instead.

Methods

RTCRtpSender.getParameters()
Returns a RTCRtpParameters object describing the current configuration for the encoding and transmission of media on the track.
RTCRtpSender.getStats()
Returns a Promise which is fulfilled with a RTCStatsReport which provides statistics data for all outbound streams being sent using this RTCRtpSender.
RTCRtpSender.setParameters()
Applies changes to parameters which configure how the track is encoded and transmitted to the remote peer.
RTCRtpSender.setStreams()
Sets the MediaStream(s) associated with the track being transmitted by this sender.
RTCRtpSender.replaceTrack()
Attempts to replace the track currently being sent by the RTCRtpSender with another track, without performing renegotiation. This method can be used, for example, to toggle between the front- and rear-facing cameras on a device.

Static methods

RTCRtpSender.getCapabilities()
Returns an RTCRtpCapabilities object describing the system's capabilities for sending a specified kind of media data.

Specifications

Specification Status Comment
WebRTC 1.0: Real-time Communication Between Browsers
The definition of 'RTCRtpSender' in that specification.
Candidate Recommendation

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
RTCRtpSenderChrome Full support YesEdge Full support ≤18Firefox Full support 34IE No support NoOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 34Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
dtmfChrome Full support YesEdge Full support ≤18Firefox Full support 52IE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 52Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
getCapabilities()Chrome Full support YesEdge Full support 12Firefox ? IE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android ? Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
getParameters()Chrome Full support 67Edge Full support ≤79Firefox Full support YesIE No support NoOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
getStats()Chrome Full support 67Edge Full support ≤18Firefox Full support 55IE No support NoOpera Full support 54Safari ? WebView Android Full support 67Chrome Android Full support 67Firefox Android Full support 55Opera Android Full support 48Safari iOS ? Samsung Internet Android Full support 9.0
replaceTrack()Chrome Full support 65Edge Full support ≤18Firefox Full support YesIE No support NoOpera Full support YesSafari Full support YesWebView Android Full support 65Chrome Android Full support 65Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support 9.0
rtcpTransportChrome No support NoEdge No support 12 — 79Firefox Full support 34IE No support NoOpera ? Safari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 34Opera Android ? Safari iOS ? Samsung Internet Android No support No
setParameters()Chrome Full support YesEdge Full support ≤79Firefox Full support 64
Notes
Full support 64
Notes
Notes Changes to parameters that should update live now do so starting in Firefox 64.
Full support 46
IE No support NoOpera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 64
Notes
Full support 64
Notes
Notes Changes to parameters that should update live now do so starting in Firefox 64.
Full support 46
Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes
trackChrome Full support YesEdge Full support 12Firefox Full support 34IE No support NoOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 34Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
transportChrome No support NoEdge No support 12 — 79Firefox Full support 34IE No support NoOpera ? Safari ? WebView Android No support NoChrome Android No support NoFirefox Android Full support 34Opera Android ? Safari iOS ? Samsung Internet Android No support No

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.

See also