Lookup time, in seconds.
Segments sorted by startTime ascending.
Forward-snap tolerance in seconds: if time falls just before a
segment's startTime (within affordance), that segment is returned. The original
time is still compared against endTime, so coverage never extends past it.
Returns the segment whose range covers
time(startTime <= time < endTime), or — whenaffordance > 0— the next segment iftimefalls withinaffordanceseconds before itsstartTime. Returnsnullif neither applies.Note: with
affordance > 0, whentimelies in the lastaffordanceseconds of a segment that does cover it, the next segment is returned instead. This is deliberate — callers useaffordanceto absorb sub-second boundary differences across qualities — but it means the result is not strictly the segment containingtime. Callers needing exact containment should passaffordance = 0.