Vidstack Player is a robust, customizable, and accessible framework and collection of UI components for building media players on the web. It is currently in version 0.6.15, designated as the 'latest' stable release, while active development continues on 'next' versions (e.g., 1.12.x). This indicates a slower stable release cadence but very frequent updates to the development branch. Vidstack differentiates itself by offering first-class TypeScript support, framework-agnostic usage (via Web Components) alongside dedicated React, Vue, Svelte, and Solid libraries, and a lean bundle size (54kB gzipped for core features). It supports various media providers including Audio, Video, HLS, DASH, YouTube, Vimeo, and Remotion, providing a single standard API across all. The library was battle-tested at Reddit, ensuring a mature architecture for managing complex media state, accessibility (WCAG 2.1 compliant), and cross-browser compatibility. It offers both headless components for full customization and production-ready default layouts, providing flexibility for developers to build custom UIs or quickly deploy a pre-built experience.
npm install vidstackVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates a basic Vidstack video player in a React component, utilizing the `@vidstack/react` package and its default layout for quick setup. It includes event handling and custom styling.
Review the migration guides for specific versions if upgrading from older 0.x releases. Update event listeners, element names, and attribute access to align with current API conventions.
For React projects, consistently use imports from `@vidstack/react` and its sub-packages. For vanilla JS or other frameworks, import Web Components via side-effects (e.g., `import 'vidstack/player';`).
For production, stick to the `latest` stable release unless you need features from `next` and are prepared for potential API changes. Monitor the GitHub repository for release announcements and changelogs if using `next`.
Audit network requests made by Vidstack in your application. For strict environments, consider self-hosting all assets or using bundler configurations to inline/copy external dependencies. Engage with the Vidstack community for fully offline solutions if critical.
Always await the `can-play` event or use the `onCanPlay` prop/event listener before invoking playback controls programmatically. For React, use `useEffect` with a ref to listen to player events.
Update event listener names and component properties to remove the `vds-` prefix. For attributes reflecting internal state, use `data-` attributes (e.g., `data-can-play`).
Ensure the `src` attribute or object includes a file extension (e.g., `.mp4`, `.m3u8`) or a `type` hint (e.g., `video/mp4`, `application/x-mpegurl`). Verify that necessary providers (like `hls.js` or `dash.js`) are correctly integrated if you are playing adaptive streams.