RemoteTrack
RemoteTrack Represents a single remote media track (either audio or video or data) of a remote Participant
Kind: global class
Properties
| Name | Type | Description |
|---|---|---|
| isSubscribed | boolean | The subscribed status of the remote track |
| isSwitchedOff | boolean | Whether the remote track is switched off |
- RemoteTrack
- instance
- .switchOn() ⇒
void - .switchOff() ⇒
void - .attach(container) ⇒
HTMLMediaElement|undefined - .detach([container]) ⇒
Array.<HTMLMediaElement>|undefined
- .switchOn() ⇒
- static
- instance
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:
ProConfErrorCLIENT_TRACK_SWITCH_ON_INVALID_STATE if the client track switch-off control is not set to manual.ProConfErrorTRACK_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:
ProConfErrorCLIENT_TRACK_SWITCH_ON_INVALID_STATE if the client track switch-off control is not set to manual.ProConfErrorTRACK_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.
| Param | Type | Default | Description |
|---|---|---|---|
| container | HTMLMediaElement | 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.
| Param | Type | Description |
|---|---|---|
| [container] | HTMLMediaElement | null | The media element to detach, or null to detach all elements. |
RemoteTrack.Events
Kind: static typedef of RemoteTrack
Properties
| Name | Type | Description |
|---|---|---|
| trackEnabled | TrackEnabledEvent | Track enabled/ unmuted event |
| trackDisabled | TrackDisabledEvent | Track event disabled/ muted event |
| trackStarted | TrackStartedEvent | Track started event |
| subscribed | SubscribedEvent | Track subscribed event |
| unsubscribed | UnsubscribedEvent | Track unsubscribed event |