Seek within the gesture. Resolves true when this target was applied,
false when a newer target superseded it or the gesture ended. Rejects
on a host failure.
keyframes: true: land on the last keyframe at or before seconds instead
of decoding up to that exact frame. The picture appears at once on any file
(tens of milliseconds instead of seconds on 4K video with keyframes far
apart), up to one keyframe interval before the target; the position the
player reports is the keyframe's. Use it when the user chose keyframe seeks
(the same switch as Player.setStepSeek), and the exact seek
otherwise. The player sends a repeated target of the same gesture only once
while the seek is still running (a click is a press and a release), but an
exact seek to the target of a keyframe seek is always sent. Omitted or
false: exact, as before.
Optionaloptions: { keyframes?: boolean }While dragging, the picture jumps to the nearest earlier keyframe at
once instead of decoding up to the exact frame. With keyframes: true
the player lands each target on the last keyframe at or before it; the
plugin follows the user's keyframe-seek setting.
const keyframes = true; // the plugin's own setting
bar.on("dragMove", (seconds: number) => void scrub?.seek(seconds, { keyframes }));
End the gesture; later seeks resolve false.
A drag gesture: each seek is conditional on the previous one, latest value wins. Any outside change (another plugin opens a file, the user pauses) ends the gesture.
Example: Seek while the user drags a slider
The video follows the slider while it is dragged.
scrub()starts a gesture from the current state; eachseekis conditional on the previous one and only the newest target is sent while one is running, so a fast drag does not queue seeks. A change from outside (another file, the user pausing) ends the gesture and later seeks resolvefalse.Remarks
A drag gesture on a seek slider. Each
seekis conditional on the previous one and only the newest target is sent while a seek is running, so a fast drag never queues seeks. Any outside change (another file, the user pausing) ends the gesture:activeturns false and later seeks resolvefalse.See
Keep a slider responsive while dragging
Since
1.0.0