Video-React is an open-source web video player library constructed using the React JavaScript library, specifically designed for modern HTML5 video environments. It provides a comprehensive suite of React components for building customizable video player interfaces, handling core functionalities such as playback control, volume management, progress indication, and full-screen toggling. The current stable version, 0.16.0, supports a broad range of React versions up to 18.0.0. While not following a strict time-based release cadence, the project actively maintains the library, with recent updates ensuring compatibility with newer React versions and addressing bugs. Its primary differentiators are its React-centric architecture, allowing for seamless integration into React applications, and its visually appealing default styling, which is heavily inspired by the well-known video.js project. Users must manually install `react` and `react-dom` as peer dependencies.
npm install video-reactVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to set up a basic Video-React player with common controls and a video source, including the essential CSS import.
Update imports and component usage from `PlaybackRate` to `PlaybackRateMenuButton`.
Add `import 'video-react/dist/video-react.css';` to your application's entry point or component where the player is used, or link it via HTML/SCSS.
Install peer dependencies: `npm install --save react react-dom` (or `yarn add react react-dom`). Refer to `video-react`'s `package.json` for supported versions.
Ensure your target audience's browsers are within the supported range. For unsupported browsers, thorough testing and custom workarounds or alternative solutions might be necessary.
Verify the CSS import path: `import 'video-react/dist/video-react.css';`. Ensure `video-react` is correctly installed in `node_modules`.
Ensure `Player` and other `video-react` components are correctly imported using named imports (e.g., `import { Player } from 'video-react';`) and are used as JSX components `<Player>...</Player>`.Ensure you are using `useRef` (for function components) or creating a class ref, and that you are accessing player methods only after the component has mounted, typically within `useEffect` or `componentDidMount`.
Replace all `require()` statements for `video-react` components with ES Module `import` statements (e.g., `import { Player } from 'video-react';`).