Video Player

A player for finished clips: in a results feed, a review step, or side by side for a video edit. Controls float over the bottom of the clip.

0:00.0 / 0:00.0

In use

The Video Studio's finished clip, with markers at the keyframe seconds. Generate a clip to see it.

Lumen
CreateEditVideo
240 credits

Your video will appear here

0s
40 credits

Installation

Installs the Scrub Bar too.

pnpm dlx shadcn@latest add https://mgp.paukraft.com/r/video-player.json

VideoPlayer

PropTypeDefault
srcstring

The clip, e.g. a FLUX 3 Video result's sample URL.

—
aspectRationumber | string

A number, CSS "16 / 9", or the API's "16:9". Set it to hold the space before the clip loads.

—
markersReactNode

On the scrub bar's track, e.g. ScrubBarMarkers at keyframe times.

—
...props<video> props

On the video, e.g. loop, muted, autoPlay, poster.

—

Parts

PropTypeDefault
VideoPlayerRoot<div> props & { aspectRatio }

The frame, with playback state. What fullscreen covers. Carries data-error while the clip fails to load.

—
VideoPlayerVideo<video> props

The clip. A click plays or pauses it.

—
VideoPlayerError<div> props

Over the frame when the clip fails to load, e.g. an expired URL, with a retry that reloads it. Children replace the message.

—
VideoPlayerControls<div> props

The bar over the bottom of the clip. On hover devices it hides while playing and idle; hidden while the clip has failed.

—
VideoPlayerPlay / Mute / FullscreenButton props

Toggles. Ghost and icon-sm by default.

—
VideoPlayerScrubBarScrubBar props

The Scrub Bar wired to the clip. Children go on its track.

—
VideoPlayerTime<span> props

Elapsed and total, e.g. "0:02.4 / 0:05.0".

—
VideoPlayerProvider{ children }

Playback state without the frame, for parts placed elsewhere. Within another provider it shares that one's clip.

—
useVideoPlayer() => MediaState & { video }

For your own controls.

—

useMediaState

useMediaState(video) keeps any <video> or <audio> in state. The player, the Video Gen Loader and the Clip Trimmer run on it.

PropTypeDefault
playing / mutedboolean

Whether it's playing, and whether it's muted.

—
currentTimenumber

Seconds; follows playback every frame.

—
durationnumber

Seconds; 0 until known.

—
bufferedTimeRange[]

Loaded spans, for the Scrub Bar.

—
errorboolean

The clip failed to load. Cleared when it reloads.

—