BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/8starlabs-ui/video-player

Video Player

8starlabs-ui/video-player
FreeComponent

A video player component

Install it

npx shadcn@latest add https://ui.8starlabs.com/r/video-player.json

Source

registry/8starlabs-ui/blocks/video-player.tsxui.8starlabs.com/r/video-player.json · first 6 KB
1"use client";
2
3import React, {
4 createContext,
5 useContext,
6 useEffect,
7 useRef,
8 useState,
9 useCallback
10} from "react";
11import {
12 ChevronDown,
13 ChevronUp,
14 AlertCircle,
15 Maximize2,
16 Minimize2,
17 Loader2,
18 Pause,
19 PictureInPicture2,
20 Play,
21 RotateCcw,
22 RotateCw,
23 Volume,
24 Volume1,
25 Volume2,
26 VolumeOff
27} from "lucide-react";
28import { cva, type VariantProps } from "class-variance-authority";
29import { cn } from "@/lib/utils";
30import { Button } from "@/registry/8starlabs-ui/blocks/button";
31
32interface VideoContextType {
33 videoRef: React.RefObject<HTMLVideoElement | null>;
34 containerRef: React.RefObject<HTMLDivElement | null>;
35 isPlaying: boolean;
36 isBuffering: boolean;
37 hasError: boolean;
38 videoProgress: number;
39 videoDuration: number;
40 areControlsShown: boolean;
41 isFullscreen: boolean;
42 isPip: boolean;
43 isVolumeControlOpen: boolean;
44 repeatVideoAutomatically: boolean;
45 autoPlayVideoUponVisible: boolean;
46 autoHideControls: boolean;
47 showCenterControls: boolean;
48 attemptTogglePlay: () => void;
49 toggleFullscreen: () => void;
50 setIsPlaying: (playing: boolean) => void;
51 setIsBuffering: (buffering: boolean) => void;
52 setHasError: (hasError: boolean) => void;
53 setVideoProgress: (progress: number) => void;
54 setVideoDuration: (videoDuration: number) => void;
55 setShowControls: (show: boolean) => void;
56 showControlsTemporarily: () => void;
57 setVolume: (x: number) => void;
58 setIsMouseOverControls: (x: boolean) => void;
59 toggleMute: (x: boolean) => void;
60 togglePip: () => void;
61 setIsVolumeControlOpen: (x: boolean) => void;
62 clearControlsTimeout: () => void;
63}
64
65const VideoContext = createContext<VideoContextType | null>(null);
66
67// Reads the shared video context and guards against using controls outside VideoRoot.
68export function useVideo(): VideoContextType {
69 const context = useContext(VideoContext);
70 if (!context) {
71 throw new Error("useVideo must be used within a VideoRoot");
72 }
73 return context;
74}
75
76export function VideoProvider({
77 repeat,
78 auto,
79 autoHideControls = true,
80 showCenterControls = true,
81 children
82}: {
83 repeat: boolean;
84 auto: boolean;
85 autoHideControls: boolean;
86 showCenterControls?: boolean;
87 children: React.ReactNode;
88}): React.ReactElement {
89 // Shared video element ref and UI state consumed by viewport and control components.
90 const videoRef = useRef<HTMLVideoElement>(null);
91 const containerRef = useRef<HTMLDivElement>(null);
92 const lastVolumeRef = useRef<number | null>(null);
93// … truncated

What it pulls in

npm packages

  • class-variance-authority

Other registry items

  • https://ui.8starlabs.com/r/button.json

Files it writes

  • registry/8starlabs-ui/blocks/video-player.tsx

Facts

Registry
8starlabs-ui
Type
registry:ui
Access
Free
Files written
1
Licence
the repository states none
In the index
at or before 2026-08-09
Last confirmed
today

Go to the source

ui.8starlabs.com Raw registry item This item as JSON

More from 8starlabs-ui

All 74 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Buttonbutton8starlabs-uiComponentsFree2 deps
Collapsiblecollapsible8starlabs-uiComponentsFree1 dep
Dropdown Menudropdown-menu8starlabs-uiComponentsFree2 deps
Flip clockflip-clock8starlabs-uiComponentsFreeno deps
Heatmapheatmap8starlabs-uiComponentsFreeno deps
Inputinput8starlabs-uiComponentsFreeno deps
JSON Viewerjson-viewer8starlabs-uiComponentsFree1 dep · 3 files
Labellabel8starlabs-uiComponentsFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex