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.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. RTCRtpSender.trackRead only- The
MediaStreamTrackwhich is being handled by theRTCRtpSender. Iftrackisnull, theRTCRtpSenderdoesn't transmit anything. RTCRtpSender.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.
Obsolete properties
rtcpTransport- This property has been removed; the RTP and RTCP transports have been combined into a single transport. Use the
transportproperty instead.
Methods
RTCRtpSender.getParameters()- Returns a
RTCRtpParametersobject describing the current configuration for the encoding and transmission of media on thetrack. RTCRtpSender.getStats()- Returns a
Promisewhich is fulfilled with aRTCStatsReportwhich provides statistics data for all outbound streams being sent using thisRTCRtpSender. RTCRtpSender.setParameters()- Applies changes to parameters which configure how the
trackis encoded and transmitted to the remote peer. RTCRtpSender.setStreams()- Sets the
MediaStream(s) associated with thetrackbeing transmitted by this sender. RTCRtpSender.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.
Static methods
RTCRtpSender.getCapabilities()- Returns an
RTCRtpCapabilitiesobject 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
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
RTCRtpSender | Chrome Full support Yes | Edge Full support ≤18 | Firefox Full support 34 | IE No support No | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support 34 | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
dtmf | Chrome Full support Yes | Edge Full support ≤18 | Firefox Full support 52 | IE No support No | Opera Full support Yes | Safari ? | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support 52 | Opera Android Full support Yes | Safari iOS ? | Samsung Internet Android Full support Yes |
getCapabilities() | Chrome Full support Yes | Edge Full support 12 | Firefox ? | IE No support No | Opera Full support Yes | Safari ? | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android ? | Opera Android Full support Yes | Safari iOS ? | Samsung Internet Android Full support Yes |
getParameters() | Chrome Full support 67 | Edge Full support ≤79 | Firefox Full support Yes | IE No support No | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
getStats() | Chrome Full support 67 | Edge Full support ≤18 | Firefox Full support 55 | IE No support No | Opera Full support 54 | Safari ? | WebView Android Full support 67 | Chrome Android Full support 67 | Firefox Android Full support 55 | Opera Android Full support 48 | Safari iOS ? | Samsung Internet Android Full support 9.0 |
replaceTrack() | Chrome Full support 65 | Edge Full support ≤18 | Firefox Full support Yes | IE No support No | Opera Full support Yes | Safari Full support Yes | WebView Android Full support 65 | Chrome Android Full support 65 | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support 9.0 |
rtcpTransport | Chrome No support No | Edge No support 12 — 79 | Firefox Full support 34 | IE No support No | Opera ? | Safari ? | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 34 | Opera Android ? | Safari iOS ? | Samsung Internet Android No support No |
setParameters() | Chrome Full support Yes | Edge Full support ≤79 | Firefox
Full support
64
| IE No support No | Opera Full support Yes | Safari ? | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android
Full support
64
| Opera Android Full support Yes | Safari iOS ? | Samsung Internet Android Full support Yes |
track | Chrome Full support Yes | Edge Full support 12 | Firefox Full support 34 | IE No support No | Opera Full support Yes | Safari Full support Yes | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android Full support 34 | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support Yes |
transport | Chrome No support No | Edge No support 12 — 79 | Firefox Full support 34 | IE No support No | Opera ? | Safari ? | WebView Android No support No | Chrome Android No support No | Firefox Android Full support 34 | Opera 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.
