JitsiTrack (base class), JitsiLocalTrack (local media), and JitsiRemoteTrack (remote participant media).
Track Hierarchy
All track classes inherit from the baseJitsiTrack class:
modules/RTC/JitsiTrack.ts:50:
Track Types
Media Types
Tracks can be either audio or video:Video Types
Video tracks have additional type classification:JitsiLocalTrack
JitsiLocalTrack represents media from the local participant (microphone, camera, or screen).
Creating Local Tracks
UseJitsiMeetJS.createLocalTracks() to create local tracks:
Track Constructor
Frommodules/RTC/JitsiLocalTrack.ts:127-147:
Track Metadata
Local tracks maintain metadata:Muting and Unmuting
Frommodules/RTC/JitsiLocalTrack.ts:877-1051:
Muting works differently for audio and video:
- Audio tracks:
track.enabledis set to false - Video tracks (browser-dependent): May remove the track from peer connection or just disable it
- Desktop tracks: Often removed from connection when muted and recreated when unmuted
Attaching to DOM Elements
Frommodules/RTC/JitsiTrack.ts:266-277:
this.containers:
Audio Levels
Monitor audio levels for local tracks:modules/RTC/JitsiTrack.ts:499-527:
Stream Effects
Apply effects like background blur or virtual backgrounds:modules/RTC/JitsiLocalTrack.ts:927-989:
Device Management
Get device information:Track Lifecycle
Frommodules/RTC/JitsiLocalTrack.ts:665-692:
Source Name and SSRC
Tracks are identified by source name and SSRC:JitsiRemoteTrack
JitsiRemoteTrack represents media from remote participants.
Constructor
Frommodules/RTC/JitsiRemoteTrack.ts:74-134:
Receiving Remote Tracks
Remote tracks are received through conference events:Remote Track Properties
Mute State
Remote track mute state is controlled by the remote participant:modules/RTC/JitsiRemoteTrack.ts:446-464:
Track Streaming Status
Monitor if a remote track is actively receiving data:Video Type Changes
Detect when a participant switches between camera and screen sharing:modules/RTC/JitsiRemoteTrack.ts:380-386:
Common Track Operations
Track Information
Both local and remote tracks provide:Audio Output Device
Change the audio output device for playback:modules/RTC/JitsiTrack.ts:536-568:
Track Dimensions
For video tracks:Track Events
All track events fromJitsiTrackEvents:
Best Practices
Track Creation and Disposal
Track Creation and Disposal
Always dispose of tracks to free resources:
Handle Track Failures
Handle Track Failures
Gracefully handle track creation failures:
Attach/Detach Properly
Attach/Detach Properly
Always detach tracks before disposal:
Monitor Track Health
Monitor Track Health
Monitor track streaming status for remote tracks:
Related Concepts
JitsiConference
Learn about adding and removing tracks from conferences
JitsiParticipant
Understand participant track management