Compartilhar via


RTCRtpSender object

[Some information relates to pre-released product which may be substantially modified before it's commercially released. Microsoft makes no warranties, express or implied, with respect to the information provided here.]

Exposes information relating to the RTP sender.

Overview

An RTCRtpSender instance is associated to a sending MediaStreamTrack and provides RTC related methods to it.

Operation

A RTCRtpSender instance is constructed from a MediaStreamTrack object and associated to an RTCDtlsTransport or an RTCSrtpSdesTransport. If an attempt is made to construct an RTCRtpSender object with transport.state or rtcpTransport.state "closed", throw an InvalidStateError exception.

Note  Edge Interop Note: The Microsoft Edge ORTC API implementation requires use of RTP/RTCP multiplexing with RTCDtlsTransport objects. Therefore only a single RTCDtlsTransport instance can be associated to an RTCRtpSender instance. RTP/RTCP non-mux is supported for RTCSrtpSdesTransport objects. Only a single RTCSrtpSdesTransport object is required to handle both RTP and RTCP.

 

Syntax

typedef (RTCDtlsTransport or RTCSrtpSdesTransport) RTCTransport;

[Constructor(MediaStreamTrack track, RTCTransport transport)]
interface RTCRtpSender : RTCStatsProvider {
    readonly    attribute MediaStreamTrack track;
    readonly    attribute RTCTransport     transport;
    void                      setTransport (RTCTransport transport);
    void                      setTrack (MediaStreamTrack track);
    static RTCRtpCapabilities getCapabilities (optional DOMString kind);
    void                      send (RTCRtpParameters parameters);
    void                      stop ();
                attribute EventHandler?    onerror;
};

Members

The RTCRtpSender object has these types of members:

  • Events
  • Methods
  • Properties

Events

The RTCRtpSender object has these events.

Event Description
onerror (RTCRtpSender)

Fires if an issue is found with the RTCRtpParameters object passed to send()

 

Methods

The RTCRtpSender object has these methods.

Method Description
getCapabilities

Obtain the sender capabilities, based on kind.

send

Media to be sent is controlled by parameters.

setTrack

Set the track.

setTransport

Set the transport (either RTCDtlsTransport or RTCSrtpSdesTransport).

stop

Stops sending the track on the wire, and sends an RTCP BYE.

 

Properties

The RTCRtpSender object has these properties.

Property Access type Description

sender

The RTCRtpSender instance.

track

Read-only

The associated MediaStreamTrack instance.

transport

Read-only

The associated transport (either an RTCDtlsTransport or an RTCSrtpSdesTransport) instance.

 

Standards information