LocalTrack ⇐ Track
TrackLocalTrack represents a single local media track (either audio or video or data)of a local Participant
Kind: global class
Extends:
TrackProperties
| Name | Type | Description |
|---|---|---|
| processor | VideoProcessor | The VideoProcessor used for applying the effect. |
- LocalTrack ⇐
Track- instance
- .enable([enabled]) ⇒
Promise.<(Track|null)> - .disable() ⇒
Promise.<(Track|null)> - .attach(container) ⇒
HTMLMediaElement|undefined - .detach(container) ⇒
HTMLMediaElement|undefined - .stop() ⇒
Promise.<(any|null)> - .restart(constraints) ⇒
Promise - .addProcessor(processor) ⇒
Track - .removeProcessor(processor) ⇒
this
- .enable([enabled]) ⇒
- static
- instance
localTrack.enable([enabled]) ⇒ Promise.<(Track|null)>
Enable or disable the local track based on the parameter.
Kind: instance method of LocalTrack
Returns: Promise.<(Track|null)> - returns track object or null as Promise
Fulfil: object
Reject: ProConfError.TRACK_ERROR
| Param | Type | Default | Description |
|---|---|---|---|
| [enabled] | boolean | true | optional default true |
localTrack.disable() ⇒ Promise.<(Track|null)>
Disable or mute the local track
Kind: instance method of LocalTrack
Returns: Promise.<(Track|null)> - returns track object or null as Promise
Fulfil: object
Reject: ProConfError.TRACK_ERROR
localTrack.attach(container) ⇒ HTMLMediaElement | undefined
Attaches the track to the given container/element.
Kind: instance method of LocalTrack
Returns: HTMLMediaElement | undefined -
- The attached media element, or undefined if none.
| Param | Type | Default | Description |
|---|---|---|---|
| container | HTMLMediaElement | string | null | | The media element or its selector to attach. |
localTrack.detach(container) ⇒ HTMLMediaElement | undefined
Removes the track to the given container/element.
Kind: instance method of LocalTrack
Returns: HTMLMediaElement | undefined -
- The attached media element, or undefined if none.
| Param | Type | Description |
|---|---|---|
| container | HTMLMediaElement | string | null | The media element or its selector to attach. |
localTrack.stop() ⇒ Promise.<(any|null)>
Stops or disposes the track. If the track is added to a room the track will be removed. Note: This method is implemented only for the local tracks.
Kind: instance method of LocalTrack
Fulfil:
Reject: ProConfError.TRACK_ERROR
localTrack.restart(constraints) ⇒ Promise
Restarts the track by stopping it and creating a new track based on the given constraints.
Kind: instance method of LocalTrack
Returns: Promise - A promise that resolves with the updated LocalTrack instance or undefined if the operation fails.
Fulfil: LocalTrack - The updated LocalTrack instance.
Reject: ProConfError - On track modify error.
| Param | Description |
|---|---|
| constraints | The constraints for the new track. |
localTrack.addProcessor(processor) ⇒ Track
Add a VideoProcessor to allow for custom processing of video frames of VideoTrack.
Kind: instance method of LocalTrack
| Param | Type | Description |
|---|---|---|
| processor | VideoProcessor | The VideoProcessor to use. |
localTrack.removeProcessor(processor) ⇒ this
Remove the previously added VideoProcessor using addProcessor API.
Kind: instance method of LocalTrack
| Param | Type | Description |
|---|---|---|
| processor | VideoProcessor | The VideoProcessor to remove. |
LocalTrack.Events
Kind: static typedef of LocalTrack
Properties
| Name | Type | Description |
|---|---|---|
| trackEnabled | TrackEnabledEvent | Track enabled/ unmuted event |
| trackDisabled | TrackDisabledEvent | Track event disabled/ muted event |
| trackStarted | TrackStartedEvent | Track started event |
| trackStopped | TrackStoppedEvent | Track stopped event |