Function
The videos in learning order
Completion marks, playback positions and the last opened video
The video to continue with, or none for an empty list
Specified by the continue-target capability. The rule finds an anchor —
the last opened video when it belongs to the list, otherwise the furthest
video with any progress — then keeps the anchor when it is unfinished, or
moves to the first unfinished video after it, or, when none follows, to the
first unfinished video of the list. A finished recorded video is therefore
never offered again.
Callers pass the videos in learning order — one module's lessons in
sequence order, or a whole course with its modules and their lessons in
sequence order. The function never sorts.
Completion uses countsAsComplete and progress uses watchedFraction, the
rules every progress indicator shares.
Callers: deriveModuleRoute (the module overview's featured step) and
courseOverviewProgress (the course overview's continue tile, and through
courseShelf My learning and Available courses).
The lesson page's Up next answers a different question — the video after the
one open — and does not use it.
Picks the video a learner continues with. The single source of truth for that question: every surface that offers to continue calls this function rather than reading the continue-watching record directly.