Installation
Get started with React Advanced Video Player in your project
Requirements
React Advanced Video Player requires the following peer dependencies:
- React 16.8+ (for Hooks support)
- ReactDOM 16.8+
Installation
Install the package using your preferred package manager:
bash
npm install react-advanced-video-player
OR
bash
yarn add react-advanced-video-player
OR
bash
pnpm add react-advanced-video-player
Basic Usage
Import and use the VideoPlayer component in your React application:
tsx
1import { VideoPlayer } from 'react-advanced-video-player';23function App() {4 return (5 <VideoPlayer 6 src="https://example.com/video.mp4" 7 poster="https://example.com/poster.jpg"8 controls9 />10 );11}
This will render a video player with default controls.
TypeScript Support
React Advanced Video Player is written in TypeScript and provides type definitions out of the box. No additional installation is needed for TypeScript support.
You can import types from the package to use in your own code:
tsx
1import { VideoPlayerProps, VideoPlayerRef } from 'react-advanced-video-player';23// Using the types4const playerProps: VideoPlayerProps = {5 src: 'https://example.com/video.mp4',6 controls: true,7 autoPlay: false,8 muted: true,9};
Next Steps
Now that you've installed React Advanced Video Player, you can explore: