GuideGetting Started
React Installation Guide
Install Video.js in React and build an accessible, customizable video player with composable controls
Video.js is a React video player component library: composable primitives, hooks, and TypeScript types for building accessible, customizable players with minimal bundle sizes, advanced features, and consistency across browsers.
AI Quickstart
Paste this prompt into your coding agent:
Install the Video.js skill using one method. In Codex, run `codex plugin marketplace add videojs/skills`, then `codex plugin add videojs@videojs`, and start a new session. In Claude Code, run `claude plugin marketplace add videojs/skills`, then `claude plugin install videojs@videojs`, and start a new session or run `/reload-plugins`. In VS Code or Cursor, install `https://github.com/videojs/skills` as a plugin from source. For another agent, run `npx skills add https://github.com/videojs/skills --skill videojs` and select the agent. Then use the Video.js skill when working on this project.Choose your JS framework
Your framework determines which installation methods are available below.
- React: Components and hooks for React 19. Available methods: Packaged, Shadcn.
- HTML: Custom elements for any stack. Available methods: Packaged, Shadcn, CDN.
- Vue: Vue 3 and Nuxt using the HTML custom elements. Available methods: Packaged, Shadcn.
- Svelte: Svelte 5 and SvelteKit using the HTML custom elements. Available methods: Packaged, Shadcn.
Choose your use case
- Video (
video): On-demand video with full controls. - Audio (
audio): Podcasts, music, and audio-only playback. - Live Video (
live-video): Streams with a Live button, no duration. - Live Audio (
live-audio): Live radio and audio streams. - Background Video (
background-video): Muted, looping video behind your content.
The live presets suit streams: they drop the duration and current-time displays that on-demand playback relies on, and they offer only media that exposes live-edge state.
Choose your skin
- Default (
default): the complete control set with a modern, frosted look. Reference pages:VideoSkin,AudioSkin,LiveVideoSkin, andLiveAudioSkin. - Minimal (
minimal): the same control set with clean, solid surfaces. Reference pages:MinimalVideoSkin,MinimalAudioSkin,MinimalLiveVideoSkin, andMinimalLiveAudioSkin. - No skin (
none): player and media behavior without a packaged UI.
Background Video always uses BackgroundVideoSkin, whatever skin you choose.
Choose your media source
Available media sources depend on the use case:
| Media source | Use cases | React component | Adapter package |
|---|---|---|---|
HTML5 Video (html5-video) | Video | Video | None |
HLS (hls) | Video, Live Video | HlsJsVideo | @videojs/hlsjs-video |
DASH (dash) | Video | DashVideo | @videojs/dash-video |
Mux (mux-video) | Video, Live Video | MuxVideo | @videojs/mux-video |
Vimeo (vimeo) | Video | VimeoVideo | @videojs/vimeo-video |
YouTube (youtube) | Video | YouTubeVideo | @videojs/youtube-video |
Cloudflare Stream (cloudflare) | Video | CloudflareVideo | @videojs/cloudflare-video |
TikTok (tiktok) | Video | TikTokVideo | @videojs/tiktok-video |
Twitch (twitch) | Video | TwitchVideo | @videojs/twitch-video |
HTML5 Audio (html5-audio) | Audio | Audio | None |
Mux (mux-audio) | Audio, Live Audio | MuxAudio | @videojs/mux-audio |
Spotify (spotify) | Audio | SpotifyAudio | @videojs/spotify-audio |
Background Video (background-video) | Background Video | BackgroundVideo | None |
HLS uses HlsJsVideo for broad compatibility. To reduce your bundle size, try our lightweight HLS engine, HlsVideo.
The keys in parentheses are the values the docs CLI (npx @videojs/cli docs guides/installation/react) accepts for its --preset, --skin, and --media flags. Run noninteractively, it also needs --source-url (pass '' for demo media) and --package-manager (npm, pnpm, yarn, or bun).
Choose how to install
Pick one starting path. These are alternatives, not steps to run in sequence. Shadcn does not provide source for background video or a no-skin player. CDN availability also depends on the selected media source.
- Packaged: Install packages and use a ready-made skin.
- Shadcn: Add editable React or HTML skin source to your project.
The code below is a complete example for the default Video, Default skin, and HTML5 Video choices with demo media. For another combination, swap in the imports and markup from the preset, skin, and media reference pages linked above, and replace the demo URL with your own.
If a preset and skin do not meet your user’s requirements, follow Customize skins to add the files for the closest skin to the project. As you develop with Video.js, rely heavily on llms.txt to make sure you always have the latest information.
Choose your JS framework
Choose the JavaScript framework for your project.
Choose your use case
The default presets work well for general website playback. The live presets suit streams: they add a Live button and drop the duration and current-time displays that on-demand playback relies on. More pre-built players to come.
Choose your skin
Choose how your player looks. You can add the files for any skin to your project and edit them later.
Choose your media source
Video.js plays plain files, adaptive streams, and embeds from hosting services, and switching between them is a one-line change. Paste a URL to detect the type, pick one directly, or upload a video to Mux.
Optional. The URL also ends up in your generated code.
Choose how to install
Choose from the installation options available for your selections.
That’s it! You now have a working Video.js player.
Own the UI
Packaged skins keep their controls and layout inside Video.js. When you need to add, remove, rearrange, or deeply restyle controls, use Shadcn to add the skin source to your project. Its components, layout, styles, and interactions become local files you can change.
Choose what to do next
Customize
Deploy
Something not quite right? You can submit an issue and ask for help, or explore other support options.
