Skip to main content

Track

Track represents a single media track (either audio or video or data).

Kind: global abstract class
Properties

NameTypeDescription
idIDThis Track's ID
kindKindThe kind of the underlying
priority-PriorityThe Track's priority can be "low", "standard", or "high".
mediaStreamTrackMediaStreamTrackThe underlying MediaStreamTrack
stateTrack.StateEnumThe state of the track
namestringThe name of the track
sidstringThe SID of the track
isEnabledbooleanThe enabled status of the track
isMutedbooleanThe muted status of the track
dimensionsobjectThe dimensions of the track

track.attach(container) ⇒ HTMLMediaElement | undefined

Attaches the track to the given container/element.

Kind: instance method of Track

ParamDefaultDescription
container
the HTML container which can be 'video' or 'audio' element.

track.detach(container) ⇒ HTMLMediaElement | Array.<HTMLMediaElement> | undefined

Removes the track to the given container/element.

Kind: instance method of Track

ParamDefaultDescription
container
the HTML container to detach from this track. If null or undefined, all containers are removed. A container can be a 'video', 'audio' or 'object' HTML element instance to which this track is currently attached to.

track.setPriority(priority) ⇒ this

Update the subscriber Track.Priority of the Remote Track. Currently setPriority has no effect on tracks.

Kind: instance method of Track
Throws:

  • RangeError
ParamTypeDescription
priorityPrioritythe updated Track.Priority.

track._getTrackName(jtrack) ⇒ string

Retrieves the track name from the provided CallLibTrack instance.

Kind: instance method of Track
Returns: string - The track name as a string.

ParamTypeDescription
jtrackCallLibTrackThe CallLibTrack instance to extract the track name from.

Track.ID : string

The Track ID is a unique identifier for the Track.

Kind: static typedef of Track

Track.SID : string

The Track SID is a unique string identifier for the Track that is published to a Room.

Kind: static typedef of Track

Track.Kind : string

The Track kind is either "audio", "video"

Kind: static typedef of Track

Track.Priority : string

The Track's priority can be "low", "standard", or "high".

Kind: static typedef of Track

Track.State : string

The state of Track can be - 'published' | 'unpublished' | 'muted' | 'unmuted';

Kind: static typedef of Track

Track.Events

Kind: static typedef of Track
Properties

NameTypeDescription
trackEnabledTrackEnabledEventTrack enabled/ unmuted event
trackDisabledTrackDisabledEventTrack event disabled/ muted event
trackStartedTrackStartedEventTrack started event