For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.

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.

MDN Reference

interface RTCRtpSender {
    dtmf: RTCDTMFSender | null;
    track: MediaStreamTrack | null;
    transform: RTCRtpScriptTransform | null;
    transport: RTCDtlsTransport | null;
    getParameters(): RTCRtpSendParameters;
    getStats(): Promise<RTCStatsReport>;
    replaceTrack(withTrack: MediaStreamTrack | null): Promise<void>;
    setParameters(
        parameters: RTCRtpSendParameters,
        setParameterOptions?: RTCSetParameterOptions,
    ): Promise<void>;
    setStreams(...streams: MediaStream[]): void;
}
Index
dtmf: RTCDTMFSender | null

The read-only dtmf property on the RTCRtpSender interface returns a RTCDTMFSender object which can be used to send DTMF tones over the RTCPeerConnection. See Using DTMF for details on how to make use of the returned RTCDTMFSender object.

MDN Reference

track: MediaStreamTrack | null

The track read-only property of the RTCRtpSender interface returns the MediaStreamTrack which is being handled by the RTCRtpSender.

MDN Reference

transform: RTCRtpScriptTransform | null

The transform property of the RTCRtpSender object is used to insert a transform stream (TransformStream) running in a worker thread into the sender pipeline. This allows stream transforms to be applied to encoded video and audio frames after they are output by a codec, and before they are sent.

MDN Reference

transport: RTCDtlsTransport | null

The read-only transport property of an RTCRtpSender object provides the RTCDtlsTransport object used to interact with the underlying transport over which the sender is exchanging Real-time Transport Control Protocol (RTCP) packets.

MDN Reference

  • The getParameters() method of the RTCRtpSender interface returns an object describing the current configuration for how the sender's track will be encoded and transmitted to a remote RTCRtpReceiver.

    MDN Reference

    Returns RTCRtpSendParameters

  • The RTCRtpSender method getStats() asynchronously requests an RTCStatsReport object which provides statistics about outgoing traffic on the RTCPeerConnection which owns the sender, returning a Promise which is fulfilled when the results are available.

    MDN Reference

    Returns Promise<RTCStatsReport>

  • The RTCRtpSender method replaceTrack() replaces the track currently being used as the sender's source with a new MediaStreamTrack.

    MDN Reference

    Parameters

    Returns Promise<void>

  • The RTCRtpSender method setStreams() associates the sender's track with the specified MediaStream objects.

    MDN Reference

    Parameters

    Returns void

Was this helpful?