Skip to main content

LocalTrack ⇐
Track

LocalTrack represents a single local media track (either audio or video or data)of a local Participant

Kind: global class
Extends:

Track

Properties

NameTypeDescription
processorVideoProcessorThe VideoProcessor used for applying the effect.

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

ParamTypeDefaultDescription
[enabled]booleantrueoptional 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.
ParamTypeDefaultDescription
containerHTMLMediaElement | 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.
ParamTypeDescription
containerHTMLMediaElement | string | nullThe 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.

ParamDescription
constraintsThe 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

ParamTypeDescription
processorVideoProcessorThe VideoProcessor to use.

localTrack.removeProcessor(processor) ⇒ this

Remove the previously added VideoProcessor using addProcessor API.

Kind: instance method of LocalTrack

ParamTypeDescription
processorVideoProcessorThe VideoProcessor to remove.

LocalTrack.Events

Kind: static typedef of LocalTrack
Properties

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