Video and audio player with an animated elastic scrubber - drag-to-seek with pointer capture, hover time preview, spring playhead, edge stretch, fullscreen, and an optional waveform surface for audio.
In the preview: hover the rail (it grows), drag to scrub, drag past either end for the elastic stretch, click anywhere on the rail and watch the playhead spring there. Demo clip: Big Buck Bunny © Blender Foundation, CC-BY 3.0.
npx shadcn@latest add @visualsandbox-ui/video-sliderRequires the one-time registry entry from Installation — or use the full URL with zero setup:
npx shadcn@latest add https://ui.visualsandbox.com/r/video-slider.jsonPulls @wavesurfer/react + wavesurfer.js for the audio waveform surface.
import VideoSlider, { AudioSlider } from "@/components/visualsandbox-ui/video-slider";
// Video: custom player chrome + the scrubber under the frame
<VideoSlider src="/clip.mp4" aspectHint={16 / 9} />
// Audio: compact cover surface, optional live waveform bound to the same element
<AudioSlider src="/track.mp3" waveform />scaleX around the near edge) and the thumb rides the deform. Disable with stretchEffect={false}.seekable ranges — sources served without HTTP range support would otherwise restart from byte 0.duration: Infinity get nudged once to force the browser to compute the real length.| Prop | Type | Default | Notes |
|---|---|---|---|
src | string | — | |
poster | string | — | Video poster, or cover art for the audio surface. |
autoPlay | boolean | false | |
loop | boolean | false | |
muted | boolean | false | |
stretchEffect | boolean | true | Elastic rail deformation past the ends. |
aspectHint | number | — | Reserves the box (w/h) before metadata arrives — no layout jump. |
onNaturalSize | (w, h) => void | — | Reports intrinsic pixel size once metadata loads. |
waveform | boolean | false | AudioSlider only: wavesurfer visualization, click-seekable. |
className | string | — |