BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/jolyui/ui/video-player

video-player

jolyui-ui/video-player
FreeComponent

jolyui/ui publishes no description for this item.

Live preview

live · rendered by the registry
Rendered by jolyui/ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://jolyui.dev/r/video-player.json

Source

ui/video-player.tsxjolyui.dev/r/video-player.json · first 6 KB
1"use client";
2
3import {
4 ChevronLeft,
5 ChevronRight,
6 ChevronsLeft,
7 ChevronsRight,
8 Loader2,
9 Maximize,
10 Maximize2,
11 MessageCircle,
12 Minimize,
13 MoreVertical,
14 Pause,
15 PictureInPicture2,
16 Play,
17 Repeat,
18 RotateCcw,
19 RotateCw,
20 Settings,
21 Volume2,
22 VolumeX,
23} from "lucide-react";
24import { AnimatePresence, motion } from "motion/react";
25import type React from "react";
26import {
27 forwardRef,
28 useEffect,
29 useImperativeHandle,
30 useRef,
31 useState,
32} from "react";
33
34interface QualitySource {
35 quality: string;
36 src: string;
37}
38
39interface CaptionTrack {
40 src: string;
41 label: string;
42 srcLang: string;
43 default?: boolean;
44}
45
46interface Chapter {
47 title: string;
48 startTime: number;
49 endTime: number;
50}
51
52export interface VideoPlayerProps {
53 src: string | QualitySource[];
54 tracks?: CaptionTrack[];
55 poster?: string;
56 title?: string;
57 description?: string;
58 compact?: boolean;
59 chapters?: Chapter[];
60 onTimeUpdate?: (time: number) => void;
61 onNextVideo?: () => void;
62 onPrevVideo?: () => void;
63 currentVideoIndex?: number;
64 totalVideos?: number;
65}
66
67export interface VideoPlayerRef {
68 seek: (time: number) => void;
69 play: () => void;
70 pause: () => void;
71}
72
73const Tooltip = ({
74 children,
75 label,
76}: {
77 children: React.ReactNode;
78 label: string;
79}) => {
80 const [isHovered, setIsHovered] = useState(false);
81
82 return (
83 <div
84 className="relative inline-flex"
85 onMouseEnter={() => setIsHovered(true)}
86 onMouseLeave={() => setIsHovered(false)}
87 role="button"
88 tabIndex={0}
89 >
90 {children}
91 <motion.div
92 initial={{ opacity: 0 }}
93 animate={{ opacity: isHovered ? 1 : 0 }}
94 transition={{ duration: 0.2 }}
95 className="pointer-events-none absolute bottom-full left-1/2 z-50 mb-2 -translate-x-1/2 whitespace-nowrap rounded bg-black/90 px-2 py-1 text-white text-xs"
96 >
97 {label}
98 </motion.div>
99 </div>
100 );
101};
102
103export const VideoPlayer = forwardRef<VideoPlayerRef, VideoPlayerProps>(
104 (
105 {
106 src,
107 tracks = [],
108 poster,
109 title: _title,
110 description: _description,
111 compact: _compact = false,
112 chapters = [],
113 onTimeUpdate,
114 onNextVideo,
115 onPrevVideo,
116 currentVideoIndex = 0,
117 totalVideos = 1,
118 },
119 ref,
120 ) => {
121 const videoRef = useRef<HTMLVideoElement>(null);
122 const containerRef = useRef<HTMLDivElement>(null);
123
124 const [isPlaying, setIsPlaying] = useState(false);
125// … truncated

What it pulls in

npm packages

  • lucide-react
  • motion

Files it writes

  • ui/video-player.tsx

Facts

Registry
jolyui/ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

Docs on jolyui/ui jolyui.dev Johuniq/jolyui on GitHub Raw registry item This item as JSON

More from jolyui/ui

All 199 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
ai-prompt-boxai-prompt-boxjolyui/uiComponentsFree4 deps
animated-beamanimated-beamjolyui/uiComponentsFree1 dep
animated-tableanimated-tablejolyui/uiComponentsFree2 deps
animated-theme-toggleanimated-theme-togglejolyui/uiComponentsFree2 deps
animated-toastanimated-toastjolyui/uiComponentsFree2 deps
animated-tooltipanimated-tooltipjolyui/uiComponentsFree1 dep
bento-gridbento-gridjolyui/uiComponentsFreeno deps
buttonbuttonjolyui/uiComponentsFree3 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex