Skip to content
FrameworkStyle

Installation

Install Video.js and build your first player with streaming support and accessible controls

Video.js is an HTML video player built on custom elements: lightweight, framework-free components for building accessible, customizable players with minimal bundle sizes, advanced features, and consistency across browsers.

If you’re working with an agent, consider providing it this guide in Markdown:

Otherwise, answer the questions below to get started quickly with your first embed code.

Choose your JS framework

Video.js aims to provide idiomatic development experiences in React components or HTML custom elements.

React
HTML

Complete the installation steps below, then visit the guide for your framework for more detailed integration information. These guides use the HTML custom elements until we add first-party Vue and Svelte packages.

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.

Video
Audio
Live Video
Live Audio
Background Video

Choose skin

Choose how your player looks.

Default
Minimal
No Skin

Choose your media source type

Video.js supports a wide range of file types and hosting services. It’s easy to switch between them.

Select your source

Or upload your media for free to Mux

Drop a video— or —

Install Video.js

<script type="module" src="https://cdn.jsdelivr.net/npm/@videojs/cdn@10.0.0-beta.32/video.js"></script>

Use your player

<!--
  The player element owns and shares state between the UI
  components and Media. Put layout on the skin or container.
 -->
<video-player>
  <!--
    Skins contain the entire player UI and are easily swappable.
    They can each be "ejected" for full control and customization
    of UI components.
   -->
  <video-skin>
    <!--
        Media are players without UIs, handling networking
        and display of the media. They are easily swappable
        to handle different sources.
      -->
    <video src="https://stream.mux.com/BV3YZtogl89mg9VcNBhhnHm02Y34zI1nlMuMQfAbl3dM/highest.mp4" playsinline></video>
  </video-skin>
</video-player>

That’s it! You now have a working Video.js player.

Change the skin’s controls or layout

To add, remove, or rearrange the skin you selected, eject it into your project. If your project does not have a components.json file, set up the CLI first. Then choose how you want the skin’s styles written and run the command below to copy its files:

HTML skins install as vanilla CSS.

npx shadcn@latest registry add @videojs=https://shadcn.videojs.org/r/html/{name}.json
npx shadcn@latest add @videojs/video

Choose what to do next

Prepare for production

Something not quite right? You can submit an issue and ask for help, or explore other support options.