Class: RemoteTrackPublication

RemoteTrackPublication

A RemoteTrackPublication represents a RemoteTrack that has been published to a Room.


Properties:
Name Type Argument Description
isSubscribed boolean

whether the published RemoteTrack is subscribed to

isTrackEnabled boolean

Deprecated: Use (track.switchOffReason !== "disabled-by-publisher") instead. This property is only valid if the corresponding RemoteTrack is subscribed to. whether the published RemoteTrack is enabled (Deprecated only for large group Rooms)

kind Track.Kind

kind of the published RemoteTrack

publishPriority Track.Priority

the Track.Priority of the published RemoteTrack set by the RemoteParticipant

track RemoteTrack <nullable>

Unless you have subscribed to the RemoteTrack, this property is null

Fires:

Extends

Events


publishPriorityChanged

The RemoteTrack's publish Track.Priority was changed by the RemoteParticipant.

Parameters:
Name Type Description
priority Track.Priority

the RemoteTrack's new publish Track.Priority; RemoteTrackPublication#publishPriority is also updated accordingly


subscribed

Your LocalParticipant subscribed to the RemoteTrack.

Parameters:
Name Type Description
track RemoteTrack

the RemoteTrack that was subscribed to


subscriptionFailed

Your LocalParticipant failed to subscribe to the RemoteTrack.

Parameters:
Name Type Description
error TwilioError

the reason the RemoteTrack could not be subscribed to


trackDisabled

The RemoteTrack was disabled. In large group Rooms, it is fired only if .isSubscribed is set to true (Deprecated only for large group Rooms).

Overrides:
Deprecated:
  • Use trackSwitchedOff (track.switchOffReason === "disabled-by-publisher") instead

trackEnabled

The RemoteTrack was enabled. In large group Rooms, it is fired only if .isSubscribed is set to true (Deprecated only for large group Rooms).

Overrides:
Deprecated:

trackSwitchedOff

The RemoteTrack was switched off. The media server stops sending media or data for the RemoteTrack until it is switched back on. Just before the event is raised, isSwitchedOff is set to true and switchOffReason is set to a TrackSwitchOffReason in large group Rooms (switchOffReason is null non-large group Rooms). Also, if the RemoteTrack receives either audio or video media, the mediaStreamTrack property is set to null. (only in large group Rooms)

Parameters:
Name Type Argument Description
track RemoteTrack

the RemoteTrack that was switched off

switchOffReason TrackSwitchOffReason <nullable>

the reason the RemoteTrack was switched off


trackSwitchedOn

The RemoteTrack was switched on. The media server starts sending media or data for the RemoteMediaTrack until it is switched off. Just before the event is raised, isSwitchedOff is set to false and switchOffReason is set to null. Also, if the RemoteTrack receives either audio or video media,the mediaStreamTrack property is set to a MediaStreamTrack that is the source of the RemoteTrack's media.

Parameters:
Name Type Description
track RemoteTrack

the RemoteTrack that was switched on


unsubscribed

Your LocalParticipant unsubscribed from the RemoteTrack.

Parameters:
Name Type Description
track RemoteTrack

the RemoteTrack that was unsubscribed from