Skip to content
Display

Video Player

Native video wrapped in token-styled custom controls: seek, volume, playback speed, and fullscreen.

Import

tsx
import { VideoPlayer } from "@cronus-ui/ui";
bash
npx cronus-ui add video-player

Examples

.cronus

The same component declared in Cronus. Emitted at build time from the audit fixtures — the kernel renders it as HTML with no React.

PortedParity: MatchGeometry 1/1Pixel diff 0 pxLogic 1/1Parity scoreboard
default.cronus
app "audit-fixtures" {
  port 5176
}

style {
  preset aurora
  theme dark
}

component VideoPlayerDefault layout:inline style:video-player {
  aria-label:"Launch video"
  label "Launch video"
}

page "/audit/video-player/default" type:custom {
  use VideoPlayerDefault
}

API Reference

Generated from the component's exported types.

VideoPlayerLabels

Skip VideoPlayerLabels props table
PropTypeDefaultDescription
play*
string—Accessible name for the play buttons (center overlay + control bar).
pause*
string—Accessible name for the pause button.
mute*
string—Accessible name for the mute button while audio is audible.
unmute*
string—Accessible name for the unmute button while audio is muted.
seek*
string—Accessible name for the seek slider.
volume*
string—Accessible name for the volume slider.
settings*
string—Accessible name for the playback-rate cycle button.
fullscreen*
string—Accessible name for the fullscreen button while windowed.
exitFullscreen*
string—Accessible name for the fullscreen button while fullscreen.

VideoPlayerProps

Extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof videoPlayerVariants>

Skip VideoPlayerProps props table
PropTypeDefaultDescription
src*
string—Video source URL.
poster
string—Preview image shown before the first frame is available.
autoPlay
booleanfalseStarts playback automatically once the media can play.
loop
booleanfalseRestarts playback from the beginning when the video ends.
muted
booleanfalseStarts with the audio muted.
aspect
"video" | "square" | "wide""video"Frame aspect ratio: 16:9 (`"video"`), 1:1 (`"square"`) or 21:9 (`"wide"`).
labels
Partial<VideoPlayerLabels>—Control-label overrides for i18n. Every label defaults to English.
videoRef
Ref<HTMLVideoElement>—Ref to the underlying `<video>` element, for imperative control.
children
ReactNode—Extra media children, e.g. a captions `<track>` or additional `<source>` elements.
asChild
boolean—Render as the child element via Slot.
className
string—Additional class names merged onto the root.
id
string—DOM id of the root element.