A track is one stream of media that a participant
sends: their camera, their microphone, or their screen. If alice has her
camera and mic on, she has two tracks.
Tracks live in your app. You create your own tracks by turning on a
device (room.enableCamera()), and you receive other people's tracks when
they publish. Showing a track on screen is how your call UI is built.
Why it exists
Plain WebRTC (the browser technology Livqeno uses for live media) can't tell a camera from a screen share. They look the same. Livqeno labels each track with its source, so your UI can, for example, show the screen share in the big tile and the cameras in small ones.
Kinds
type TrackKind = 'camera' | 'microphone' | 'screenShare' | 'unknown';unknown means the source was never set. Livqeno doesn't guess it's a camera.
Your tracks and others' tracks
| Type | What it is | Where it comes from |
|---|---|---|
LocalTrack | A track you publish. | You turn on a device. |
RemoteTrack | A track from someone else that you subscribed to. | Someone else publishes; you get trackSubscribed. |
Lifecycle
alice: enableCamera() → her LocalTrack is published
bob: trackSubscribed → bob gets a RemoteTrack, and attaches it to show it
alice: mute() → bob gets trackMuted (track stays; tile stays)
alice: disableCamera() → track removed, camera released; bob gets trackUnpublished
Showing a track
In your browser app, both kinds have attach() and detach():
const el = track.attach(); // a <video> or <audio>, wired up
document.body.append(el);
track.detach(); // stops playback, detaches every elementattach() creates the element for you. It sets autoplay, playsInline,
and muted correctly, so video actually plays (browsers block video that
isn't set up this way).
Mute is not the same as turning off
Pick the one that matches your button:
const camera = await room.enableCamera();
await camera.mute(); // stops sending, stays published
await camera.unmute(); // instant — nothing was torn down
await room.disableCamera(); // unpublishes entirely| Action | What happens | Use it for |
|---|---|---|
mute() | Stops sending. The track stays. Others see trackMuted. | A quick "camera off" / "mic off" toggle. |
unmute() | Starts again instantly. Others see trackUnmuted. | Turning it back on. |
disableCamera() | Removes the track completely. | Releasing the camera (the camera light turns off). |
Because muting keeps the track, others keep your video tile on screen. You can show a "camera off" icon on it instead of making it disappear.
You can only mute your own tracks. You can't mute someone else's mic. You can only stop subscribing to it.
Next steps
- Tracks & publishing: the full lifecycle and options.
- Screen sharing: publish a
screenSharetrack. - Audio & video: choosing devices and quality.