Autoplay
Advance on a dwell, and the rules for pausing.
One option. The number is the dwell: how long to rest on an item before moving to the next one.
createPicker(el, {
items,
renderItem,
autoplay: 1800,
})Dwell is measured from where the track came to rest, not from when the last move started, so a slow settle never eats into the time an item is readable.
What holds it
Autoplay does not resume until every reason to be paused has gone. The reasons overlap in practice, since a pointer can rest on the track, drag it, and leave the tab hidden all at once, so it tracks them by name rather than as a flag.
| Hold | Released when |
|---|---|
| the track is moving | it settles |
| the pointer is over it | the pointer leaves |
| the tab is hidden | it becomes visible |
you called pause() | you call play() |
picker.pause() // holds until play(), whatever else happens
picker.play() // an explicit play clears every holdAt the end of a clamped track
A track with loop: 'clamp' stops on its last item rather than rewinding to the
start. Rewinding would read as a glitch, since a clamped track has ends on purpose.