Video Player

An on-demand video player built on Video.js 10, with the skin themed by the shadcn/ui tokens, a composable media element and declarative text tracks.

UIvideo-playerView JSON

The shell is the Video.js video preset and its skin; the media element is a separate component, so the shell never needs to change when the source does. The skin only exposes its published settings, and Blocove sets them from your shadcn/ui tokens: radius, hairline, font and scale follow theme changes, while the accent keeps the contrasting default unless you pass `accentColor`.

Preview

Composable media components
0:00

Installation

Add the item with the shadcn CLI, or copy the source manually.

pnpm dlx shadcn@latest add litingyes/blocove/video-player

Requires a shadcn/ui project set up with Base UI primitives. Blocove is developed against the b0 preset, but it installs no base config or theme tokens: your own preset, fonts and colors stay in place.

Or install from the namespace after adding the registry: npx shadcn@latest add @blocove/video-player

API Reference

Props accepted by the exported components.

VideoPlayer

The on-demand video preset and its skin, themed with the shadcn/ui tokens. Compose the media inside it. The player element renders nothing itself, so the classic shadcn attributes (`className`, `style`, `children`) belong to this component.

PropTypeDefault
titlestring | null-
posterstring | null-
aspectRatio'video' | 'classic' | 'square' | 'portrait' | 'wide' | 'auto''video'
accentColorstringSkin default
objectFit'contain' | 'cover' | 'fill' | 'none' | 'scale-down'Skin default
objectPositionstringSkin default
renderPoster(props) => ReactNode-
classNamestring-
styleCSSProperties-
childrenReactNodeRequired

VideoMedia

The native `<video>` element. It registers itself as the player's media on mount and forwards every native attribute, so `autoPlay`, `muted`, `loop` and the media events work as usual.

PropTypeDefault
srcstring-
tracksMediaTrack[]-
playsInlinebooleantrue
preload'none' | 'metadata' | 'auto''metadata'
...propsVideoHTMLAttributes<HTMLVideoElement>-

MediaTrack

One text track. Captions are the default kind, and the same declarations feed the video and audio media components.

PropTypeDefault
srcstringRequired
labelstringRequired
srcLangstringRequired
kind'captions' | 'subtitles' | 'descriptions' | 'chapters' | 'metadata''captions'
defaultboolean-