StreamSourceSequenceSettings.onAdvance property

Fires when the node has handed off to a new active source. The pin in the callback is whichever source is now feeding the output.

lastSeenPts, when present, is the last PTS (microseconds) the engine emitted from the PREVIOUS active pin — the source that just ended. Absent (undefined) on the very first Advance (no previous source). Clients use this for cross-switch PTS continuity: feed it back as anchorPts on a sibling switch’s releasePreloaded so the next pin’s video PTS picks up where the previous pin’s last PTS left off.

Signature:

onAdvance?: (nowActive: Pins, lastSeenPts: number | undefined) => void;