Link Search Menu Expand Document

Properties

mediaStreamTrack

PeerTrack MediaStreamTrack, use it for render video or audio in your application

@returns MediaStreamTrack readonly

label

Label of PeerTrack or audio in your application

@returns TrackLabel readonly

isPaused

Is the track now paused

@returns Boolean readonly

getVideoAvailableLayers

Available spatial layers for PeerTrack See more about Simulcast

@returns SpatialLayerParams[] readonly

currentSpatialLayer

Current index of the entry in encodings representing the highest RTP stream that will be transmitted. The number of spatial layers is provided in create video track methods in VideoEncoderConfig.
See more about Simulcast

@returns Number readonly

Methods

pause()

Pauses the PeerTrack. Internally the library sets track.enabled = false in the remote track.

@async


resume()

Resumes the PeerTrack. Internally the library sets track.enabled = true in the remote track.

@async


close()

Close PeerTrack


setPriority()

Sets the priority for this consumer. It affects how the estimated outgoing bitrate in the transport (obtained via transport-cc or REMB) is distributed among all video consumers, by prioritizing those with higher priority.

Argument Type Description Required Default
priority number Range from 1 (minimum) to 255 (maximum) Yes  

@async @throws Can`t change stream priority


requestVideoPreferredLayers()

Sets the preferred (highest) spatial and temporal layers to be sent to the consuming endpoint. You can see available layers and their params in PeerTrack properties.

Argument Type Description Required Default
layers RequestVideoPreferredLayersParams   Yes  

@async @throws Error request preferred layers

Params

SpatialLayerParams

Field Type Required
width Number No
height Number No
…RtpEncodingParameters RtpEncodingParameters No

RequestVideoPreferredLayersParams

Field Type Required
spatialLayer Number No
temporalLayer Number No