Compartir a través de


receive method

[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.]

The associated parameters controlling the media to be received.

If receive(parameters) is called with invalid parameters, throw an InvalidParameters exception. If transport is an RTCDtlsTransport and receive(parameters) is called with parameters.rtcp.mux set to false, throw an InvalidParameters exception. The receive() method does not update parameters based on what is currently being received, so that the value of parameters remains that last passed to the receive() method.

The RTCRtpReceiver object starts receiving when receive() is called for the first time, and changes the receiving parameters when receive() is called again. The RTCRtpReceiver object stops receiving when stop() is called. After receive() returns, track is set. The value of track.kind is determined based on the kind used in the constructor, which must match that of the codecs provided in parameters.codecs. If parameters.codecs are of mixed kind, or are of a single kind which does not match the value used in the constructor, throw an InvalidParameters exception. For this purpose a kind of "" is not considered mixed.

Syntax

var retval = RTCRtpReceiver.receive(parameters);

Parameters

  • parameters
    Type: RTCRtpParameters

    The Rtp Parameters for the associated RTP Receiver.

Return value

This method does not return a value.

Standards information

See also

RTCRtpReceiver