video-player
kibo-ui-registry/video-playerFreeComponent
A composable, shadcn/ui styled video player component that uses the media-chrome library.
Live preview
live · rendered by the registry
Rendered by Kibo UI Registry on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.kibo-ui.com/r/video-player.jsonSource
1"use client";23import {4 MediaControlBar,5 MediaController,6 MediaMuteButton,7 MediaPlayButton,8 MediaSeekBackwardButton,9 MediaSeekForwardButton,10 MediaTimeDisplay,11 MediaTimeRange,12 MediaVolumeRange,13} from "media-chrome/react";14import type { ComponentProps, CSSProperties } from "react";15import { cn } from "@/lib/utils";1617export type VideoPlayerProps = ComponentProps<typeof MediaController>;1819const variables = {20 "--media-primary-color": "var(--primary)",21 "--media-secondary-color": "var(--background)",22 "--media-text-color": "var(--foreground)",23 "--media-background-color": "var(--background)",24 "--media-control-hover-background": "var(--accent)",25 "--media-font-family": "var(--font-sans)",26 "--media-live-button-icon-color": "var(--muted-foreground)",27 "--media-live-button-indicator-color": "var(--destructive)",28 "--media-range-track-background": "var(--border)",29} as CSSProperties;3031export const VideoPlayer = ({ style, ...props }: VideoPlayerProps) => (32 <MediaController33 style={{34 ...variables,35 ...style,36 }}37 {...props}38 />39);4041export type VideoPlayerControlBarProps = ComponentProps<typeof MediaControlBar>;4243export const VideoPlayerControlBar = (props: VideoPlayerControlBarProps) => (44 <MediaControlBar {...props} />45);4647export type VideoPlayerTimeRangeProps = ComponentProps<typeof MediaTimeRange>;4849export const VideoPlayerTimeRange = ({50 className,51 ...props52}: VideoPlayerTimeRangeProps) => (53 <MediaTimeRange className={cn("p-2.5", className)} {...props} />54);5556export type VideoPlayerTimeDisplayProps = ComponentProps<57 typeof MediaTimeDisplay58>;5960export const VideoPlayerTimeDisplay = ({61 className,62 ...props63}: VideoPlayerTimeDisplayProps) => (64 <MediaTimeDisplay className={cn("p-2.5", className)} {...props} />65);6667export type VideoPlayerVolumeRangeProps = ComponentProps<68 typeof MediaVolumeRange69>;7071export const VideoPlayerVolumeRange = ({72 className,73 ...props74}: VideoPlayerVolumeRangeProps) => (75 <MediaVolumeRange className={cn("p-2.5", className)} {...props} />76);7778export type VideoPlayerPlayButtonProps = ComponentProps<typeof MediaPlayButton>;7980export const VideoPlayerPlayButton = ({81 className,82 ...props83}: VideoPlayerPlayButtonProps) => (84 <MediaPlayButton className={cn("p-2.5", className)} {...props} />85);8687export type VideoPlayerSeekBackwardButtonProps = ComponentProps<88 typeof MediaSeekBackwardButton89>;9091export const VideoPlayerSeekBackwardButton = ({92 className,93 ...props94// … truncated
What it pulls in
npm packages
Files it writes
More from Kibo UI Registry
All 41 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| announcementannouncement | Kibo UI Registry | Components | Free | no deps | |
| avatar-stackavatar-stack | Kibo UI Registry | Components | Free | no deps | |
| bannerbanner | Kibo UI Registry | Components | Free | 2 deps | |
| calendarcalendar | Kibo UI Registry | Components | Free | 3 deps | |
| choiceboxchoicebox | Kibo UI Registry | Components | Free | 2 deps | |
| code-blockcode-block | Kibo UI Registry | Components | Free | 5 deps · 2 files | |
| color-pickercolor-picker | Kibo UI Registry | Components | Free | 3 deps | |
| comboboxcombobox | Kibo UI Registry | Components | Free | 2 deps |
