Media | SeekBar
SeekBar#
Description#
- Progress bar for audio and video players. Shows elapsed time, duration and a draggable thumb.
- Uses an invisible
<input type="range">layered over adiv-based drawing, to leverage native drag, keyboard and accessibility. - With
durationat zero nothing is drawn (live streams); withseekablefalse the bar is shown but cannot be moved.
Props#
position(number) — Current position in the same unit asduration. Required.duration(number) — Total duration. At zero, the bar is not drawn. Required.seekable(boolean) — Whether the player allows seeking. Default:true.step(number) — How much the keyboard arrows advance, in the same unit. Default:1.format((value: number) => string) — How a time is formatted. Default:formatPlaybackTime.label(string) — Label for the screen reader. Without this,media.seekfrom the catalogue is used. Default:undefined.
Emits#
seek(number) — Emitted when the thumb is released, with the new position in the unit ofposition.
Usage#
| |
Notes#
position,durationandstepare in the same unit (seconds, microseconds, etc.);formatis the only prop that needs to know it.- The thumb appears on hover or focus, and the position is overridden during drag.