Skip to main content

RemoteTrack

RemoteTrack Represents a single remote media track (either audio or video or data) of a remote Participant

Kind: global class
Properties

NameTypeDescription
isSubscribedbooleanThe subscribed status of the remote track
isSwitchedOffbooleanWhether the remote track is switched off

remoteTrack.switchOn() ⇒ void

Enable the track of remote participant on client side if allowed by configuration Throws an error if the track cannot be enabled due to an invalid state.

Kind: instance method of RemoteTrack
Throws:

  • ProConfError CLIENT_TRACK_SWITCH_ON_INVALID_STATE if the client track switch-off control is not set to manual.
  • ProConfError TRACK_ERROR for any other errors that occur during the process.

remoteTrack.switchOff() ⇒ void

Disable the track of remote participant on client side if allowed by configuration Throws an error if the track cannot be enabled due to an invalid state.

Kind: instance method of RemoteTrack
Throws:

  • ProConfError CLIENT_TRACK_SWITCH_ON_INVALID_STATE if the client track switch-off control is not set to manual.
  • ProConfError TRACK_ERROR for any other errors that occur during the process.

remoteTrack.attach(container) ⇒ HTMLMediaElement | undefined

Attaches a media element to the track and observes its visibility if it's a video track. If the client track switch-off control is set to auto, it starts observing the visibility of the element.

Kind: instance method of RemoteTrack
Returns: HTMLMediaElement | undefined -

  • The attached media element, or undefined if none.
ParamTypeDefaultDescription
containerHTMLMediaElement | string | null
The media element or its selector to attach.

remoteTrack.detach([container]) ⇒ Array.<HTMLMediaElement> | undefined

Removes a media element from the track and stops observing its visibility.

Kind: instance method of RemoteTrack
Returns: Array.<HTMLMediaElement> | undefined -

  • An array of detached media elements, or undefined if none.
ParamTypeDescription
[container]HTMLMediaElement | nullThe media element to detach, or null to detach all elements.

RemoteTrack.Events

Kind: static typedef of RemoteTrack
Properties

NameTypeDescription
trackEnabledTrackEnabledEventTrack enabled/ unmuted event
trackDisabledTrackDisabledEventTrack event disabled/ muted event
trackStartedTrackStartedEventTrack started event
subscribedSubscribedEventTrack subscribed event
unsubscribedUnsubscribedEventTrack unsubscribed event