Skip to main content

Overview

The JitsiRemoteTrack class represents a single remote media track (either audio or video) received from another participant in the conference.

Constructor

RTC
required
The RTC service instance
JitsiConference
required
The conference to which this track belongs
string
required
The endpoint ID of the track owner
MediaStream
required
WebRTC MediaStream, parent of the track
MediaStreamTrack
required
Underlying WebRTC MediaStreamTrack
MediaType
required
The type of the media (‘audio’ or ‘video’)
VideoType
required
The type of the video (‘camera’ or ‘desktop’)
number
required
The SSRC number of the Media Stream
boolean
required
The initial muted state
boolean
required
Indicates whether this track belongs to a P2P session
string
required
The source name signaled for the track

Methods

dispose()

Removes attached event listeners and disposes the track streaming status.
Promise
Resolves when disposal is complete

setMute()

Sets the current muted status and fires events for the change.
boolean
required
The muted status to set

isMuted()

Returns the current muted status of the track.
boolean
True if the track is muted, false otherwise

getParticipantId()

Returns the participant ID which owns the track.
string
The ID of the participant (corresponds to Colibri endpoint ID/MUC nickname)

getSsrc()

Returns the synchronization source identifier (SSRC) of this remote track.
number
The SSRC of this remote track

getSourceName()

Returns the track’s source name.
string
The source name identifier

setOwner()

Updates the properties when the track is remapped to another source.
string
required
The endpoint ID of the new owner

setSourceName()

Sets the name of the source associated with the remote track.
string
required
The source name to be associated with the track

getTrackStreamingStatus()

Returns the track’s streaming status.
TrackStreamingStatus | null
The streaming status of the track, or null if not initialized. Possible values:
  • ACTIVE - Track is actively receiving media
  • INACTIVE - Track is not receiving media
  • RESTORING - Track is in the process of restoring
  • INTERRUPTED - Track streaming was interrupted

toString()

Creates a text representation of this remote track instance.
string
String representation including user ID, type, SSRC, P2P status, source name, and track status

Internal Methods

The following methods are marked as internal and are primarily used by the library itself.

_setVideoType()

Changes the video type of the track.
VideoType
required
The new video type (‘camera’ or ‘desktop’)

_setTrackStreamingStatus()

Updates the track’s streaming status.
TrackStreamingStatus
required
The current track streaming state

_setEnteredForwardedSourcesTimestamp()

Updates the timestamp of when the track entered forwarded sources.
number
required
The time in milliseconds

_getEnteredForwardedSourcesTimestamp()

Returns the timestamp of when the track entered forwarded sources.
number | null
The time in milliseconds or null

_clearEnteredForwardedSourcesTimestamp()

Clears the timestamp of when the track entered forwarded sources.

Properties

string
The endpoint ID of the participant who owns this track
boolean
Indicates whether this track belongs to a peer-to-peer session
string | null
The RTC identifier for this track

Events

JitsiRemoteTrack extends JitsiTrack and emits additional events:
  • TRACK_MUTE_CHANGED - Fired when the mute status changes
  • TRACK_VIDEOTYPE_CHANGED - Fired when the video type changes
  • TRACK_STREAMING_STATUS_CHANGED - Fired when the streaming status changes
  • REMOTE_TRACK_MUTE - Fired when the remote track is muted
  • REMOTE_TRACK_UNMUTE - Fired when the remote track is unmuted

Track Streaming Status

The TrackStreamingStatus indicates the current state of media reception:
  • ACTIVE - Track is actively receiving media data
  • INACTIVE - Track is not receiving media data
  • RESTORING - Track entered forwarded sources and is attempting to restore
  • INTERRUPTED - Track streaming was interrupted (no data received within timeout)

Example Usage