msf.Broadcast is an optional helper that integrates an MSF catalog with moqt.TrackHandler routing. It manages the catalog snapshot and per-track handlers together, automatically serving the catalog track and dispatching subscriptions to the appropriate handler.
Create a Broadcast
Broadcast and call SetCatalog later.
msf.Broadcast
Register Tracks
RegisterTrack adds a track to the catalog and associates a moqt.TrackHandler with it. If a track with the same name already exists, it is replaced. The catalog is validated after modification.
The reserved catalog track name ("catalog" by default) cannot be used.
Remove Tracks
RemoveTrack removes the named track and its handler from the broadcast. Returns true if the track was present.
Use as TrackHandler
msf.Broadcast implements moqt.TrackHandler, so it can be published directly:
Update Catalog
SetCatalog replaces the catalog snapshot atomically. Tracks present in the old catalog but absent in the new one are automatically removed along with their handlers.
Catalog Track
The catalog is served as a special track (default name:"catalog"). When a subscriber requests this track, the current catalog snapshot is serialized as JSON and written as a single group with one frame.
msf.DefaultCatalogTrackName.