ScrubState

The three calls a scrubbing gesture makes, in order.

Call onScrubStart on touch down, onScrubTo on every drag delta and onScrubEnd on touch up. Between the first and the last the engine relaxes seek accuracy to keep up with the finger, and the last one settles on the exact frame under it. A gesture that never calls onScrubStart seeks nothing, since onScrubTo is ignored outside a gesture.

Built by rememberScrubState, either over a VideoPlayer or over a host's own transport.

Properties

Link copied to clipboard

Whether a gesture is in flight.

Functions

Link copied to clipboard

Leaves scrubbing mode and settles on the frame the gesture ended on.

Link copied to clipboard

Enters scrubbing mode. Repeating it during a gesture does nothing.

Link copied to clipboard
fun onScrubTo(position: Duration)

Moves the playhead to position. Ignored outside a gesture.