Participant-video counters, with where frames are encoded and the encoder's own counters.
LiveKit's active-speaker list changed (loudest first, VERIFY). Only people count: the bot itself and other agents are dropped, and so is anyone not in the room's remote participants.
A participant's attributes changed: an opt-out stops their sources at once; an opt-in may be picked.
A participant muted a track: a muted source is not read, nor received.
A participant published a track: a screen share is stamped as the most recent, then the room is ranked.
A video track reached the bot: read it when it is selected or the ranking picks it, else unsubscribe it.
LiveKit refused a subscription the watcher asked for (TrackSubscriptionFailed, which names the track by sid). The
source is passed over for a while, and the next one is picked.
Optionalerror: stringA participant unmuted a track: it may be picked again at once.
A participant unpublished a track.
A track stopped reaching the bot. Ends the source it carried; a source still waiting for its subscription stays.
The bot is leaving: cancels every reader and the pending ranking. Reports no ended sources. Idempotent.
Owns participant video inside the bot. One instance per room session; see the file header for its rules.