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 usingtelephone-event
payloads on the RTP session represented by theRTCRtpSender
object. Ifnull
, 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 theRTCRtpSender
. Iftrack
isnull
, theRTCRtpSender
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 isnull
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 thetrack
. RTCRtpSender.getStats()
- Returns a
Promise
which is fulfilled with aRTCStatsReport
which provides statistics data for all outbound streams being sent using thisRTCRtpSender
. 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 thetrack
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 BrowsersThe 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.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
RTCRtpSender
|
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 |
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 Full support 64 Notes' Changes to parameters that should update live now do so starting in Firefox 64. Full support 46 |
IE
No support No |
Opera
Full support Yes |
Safari
? |
WebView Android
Full support Yes |
Chrome Android
Full support Yes |
Firefox Android Full support 64 Full support 64 Notes' Changes to parameters that should update live now do so starting in Firefox 64. Full support 46 |
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.
See also
RTCRtpSender by Mozilla Contributors is licensed under CC-BY-SA 2.5.