Getting Started
Installation
This section will get you up and running with the library. You'll find specific instructions below depending on the type of installation method (NPM or CDN), library (HTML, React, etc.), and provider (Audio, Video, HLS, etc.) you opt to use.
Select Install Method
Locally installing the package via NPM is best when you're integrating the library with build tools such as Parcel, Rollup, Vite, or Webpack. We ship both an un-optimized development bundle that includes logs, and a production bundle that is specially minified to get the bundle size as small as possible. Thanks to Node package exports your bundler will automatically load the correct type based on the Node process environment
NODE_ENV
.Select JS Library
The
HTML
option refers to our Web Components library. Our custom elements can be used anywhere with the simple drop of an import or CDN link as they're natively supported by browsers. This option is best when writing plain HTML or using a JS library such as Angular. Native web components have excellent support in most libraries.Select Media Provider
Embed video content into documents via the native
video
element.Select Styling
The Community Skin is our production-ready UI when you're looking for something pre-designed and ready out of the box. See the Skins docs for previews, features, and customization options.
Install NPM Package
Install
vidstack
and dependencies via NPM.Register Elements
Register the custom media elements and base styles.
You can also register specific elements like so:
Add Player Markup
Add the following player HTML boilerplate to get started.
Add Global Types
Add global Vidstack types if you're using TypeScript.
Customizing Skins
See the Skins docs for further skin customization options.
Media Icons
This step is optional. Media Icons is a collection of icons we've designed at Vidstack to help with building audio and video player user interfaces. If you plan on building your components up yourself (i.e., not using a skin or any defaults), then you can follow the instructions below to start using our icons.
First, install the media-icons
package:
Next, import icons:
Finally, use them like so:
👉 Preview the entire collection in our media icons catalog.