What is a track?
A track is a named media stream between your app and the model. Tracks carry video, audio, or any other data the model expects or produces. Every track has a name that both sides use to identify it.Server-driven track configuration
Track configuration is server-driven. Each model declares the tracks it exposes in its schema, which is the same schema documented on each model’s reference page. Your app does not need to declare tracks up front; the SDK reads the schema and sets up the WebRTC connection accordingly. For the authoritative list of tracks a model exposes, see its Schema page in the Model API Reference. For example, Helios or LingBot. Every track has aname, a kind ("video" or "audio"), and a direction:
recvonlytracks are outputs from the model to your app (e.g. generated video).sendonlytracks are inputs from your app to the model (e.g. webcam feed).
Schema (tracks)
Output tracks (model to app)
The SDK receives the model’s output tracks automatically. Read them by name once the track arrives.ready. In JavaScript, connect with
autoResumeTracks: false to start unsubscribed, then call resumeTrack(name) / pauseTrack(name)
to switch a track on or off; in Python, call track.resume() / track.pause() on the
Track itself. See
connect().
Python’s
connect() has no auto_resume_tracks option — every output track always starts
subscribed. Call track.pause() right after connect() if you need one unsubscribed from the
start.Input tracks (app to model)
Some models accept input tracks (e.g. a webcam feed for video-to-video transformation). Input tracks are explicit: the model receives nothing on asendonly track until your app publishes a media
track to it. Connecting alone never starts sending, so publish once the connection reaches ready.
The JavaScript variant captures the webcam with getUserMedia; in React the WebcamStream
component captures and publishes for you.
unpublishTrack(name) (or track.unpublish() / reactor.unpublish_track(name) in Python) to
stop sending a track. Typically you do this on disconnect or when the source media stops.
Only one connection may publish a given input track at a time. In a session shared by multiple
connections, publishing a track that another connection already holds is rejected until that
connection unpublishes it.
Naming convention
Here’s how track names map between the model and your app:reactor.track(name) returns an object with publish(),
push_frame(), on_frame(), and pause()/resume() that refuse whatever the track’s direction
doesn’t allow, rather than silently doing nothing for a typo’d name. When you don’t want to
hardcode the name, reactor.tracks filters by kind and
direction instead: reactor.tracks.with_direction("recvonly").with_kind("video").one().