Track
Track represents a single media track (either audio or video or data).
Kind: global abstract class
Properties
| Name | Type | Description |
|---|---|---|
| id | ID | This Track's ID |
| kind | Kind | The kind of the underlying |
| priority- | Priority | The Track's priority can be "low", "standard", or "high". |
| mediaStreamTrack | MediaStreamTrack | The underlying MediaStreamTrack |
| state | Track.StateEnum | The state of the track |
| name | string | The name of the track |
| sid | string | The SID of the track |
| isEnabled | boolean | The enabled status of the track |
| isMuted | boolean | The muted status of the track |
| dimensions | object | The dimensions of the track |
- Track
- instance
- .attach(container) ⇒
HTMLMediaElement|undefined - .detach(container) ⇒
HTMLMediaElement|Array.<HTMLMediaElement>|undefined - .setPriority(priority) ⇒
this - ._getTrackName(jtrack) ⇒
string
- .attach(container) ⇒
- static
- instance
track.attach(container) ⇒ HTMLMediaElement | undefined
Attaches the track to the given container/element.
Kind: instance method of Track
| Param | Default | Description |
|---|---|---|
| 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
| Param | Default | Description |
|---|---|---|
| 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
| Param | Type | Description |
|---|---|---|
| priority | Priority | the 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.
| Param | Type | Description |
|---|---|---|
| jtrack | CallLibTrack | The 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
| Name | Type | Description |
|---|---|---|
| trackEnabled | TrackEnabledEvent | Track enabled/ unmuted event |
| trackDisabled | TrackDisabledEvent | Track event disabled/ muted event |
| trackStarted | TrackStartedEvent | Track started event |