
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
react-smart-video-player
Advanced tools
A fully-featured, YouTube-like video player built completely from scratch using React and TypeScript — no third-party video libraries involved.
Perfect for developers looking for a clean, minimal, extensible, and dependency-free media player.
<canvas> + <video> thumbnail preview<video> + <canvas>.Try it online (no setup required):
👉 StackBlitz Demo
🔗 Links
🔧 GitHub: https://github.com/arun59ay/react-video-player
📦 NPM: https://www.npmjs.com/package/react-smart-video-player
⚡ Live Demo: https://stackblitz.com/github/arun59ay/react-video-player
npm install react-video-player
You also need to import the default styles manually:
import 'react-video-player/dist/index.css';
import React from 'react';
import { VideoPlayer } from 'react-video-player';
import 'react-video-player/dist/index.css';
export default function App() {
return (
<VideoPlayer
src="/videos/sample.mp4"
poster="/images/thumb.jpg"
title="Demo Player"
theme="dark"
/>
);
}
import React from 'react';
import { VideoPlayer } from 'react-video-player';
import 'react-video-player/dist/index.css';
const App = () => (
<VideoPlayer
src="/videos/sample.mp4"
poster="/images/thumb.jpg"
captions="/captions/subtitles.vtt"
title="Advanced Demo Player"
theme="light"
autoplay={false}
loop={false}
muted={false}
controls={true}
width="800px"
height="450px"
className="my-custom-player"
style={{ borderRadius: '12px' }}
onPlay={() => console.log('Video started')}
onPause={() => console.log('Video paused')}
onTimeUpdate={(time) => console.log('Time:', time)}
onVolumeChange={(vol) => console.log('Volume:', vol)}
onSeek={(time) => console.log('Seeked to:', time)}
onEnded={() => console.log('Ended')}
onError={(err) => console.error('Error:', err)}
/>
);
🎮 Keyboard Shortcuts
| Action | Keys |
| ----------------- | --------- |
| Play / Pause | Space / K |
| Seek -10s | ← / J |
| Seek +10s | → / L |
| Volume Up | ↑ |
| Volume Down | ↓ |
| Mute / Unmute | M |
| Fullscreen Toggle | F |
| Speed Down | Shift + , |
| Speed Up | Shift + . |
| Go to Start | Home |
| Go to End | End |
📋 Props API
| Prop | Type | Default | Description |
| ----------- | --------------------- | ----------- | ----------------------------------- |
| `src` | `string` | — *(req)* | Video source URL |
| `poster` | `string` | `undefined` | Poster image |
| `captions` | `string` | `undefined` | WebVTT subtitles file |
| `title` | `string` | `undefined` | Accessible title for screen readers |
| `theme` | `'light' \| 'dark'` | `'dark'` | UI Theme |
| `autoplay` | `boolean` | `false` | Autoplay on load |
| `loop` | `boolean` | `false` | Loop the video |
| `muted` | `boolean` | `false` | Mute by default |
| `controls` | `boolean` | `true` | Show/hide player controls |
| `width` | `string` or `number` | `'100%'` | Custom player width |
| `height` | `string` or `number` | `'auto'` | Custom player height |
| `className` | `string` | `''` | Custom class for the wrapper |
| `style` | `React.CSSProperties` | `{}` | Inline styles |
🧠 Event Callbacks
| Callback | Type | Description |
| ---------------- | -------------------------- | ------------------------------ |
| `onPlay` | `() => void` | Triggered when playback starts |
| `onPause` | `() => void` | Triggered when paused |
| `onTimeUpdate` | `(time: number) => void` | On time change during playback |
| `onVolumeChange` | `(volume: number) => void` | On volume update |
| `onSeek` | `(time: number) => void` | When seeking is done |
| `onEnded` | `() => void` | When video ends |
| `onError` | `(error: string) => void` | If video load/playback fails |
## 🎨 Styling (CSS Variables)
Override the look via your own styles:
```css
.rvp-video-player {
--rvp-primary-color: #ff0000;
--rvp-background-color: rgba(0, 0, 0, 0.85);
--rvp-text-color: #fff;
--rvp-border-radius: 10px;
}
react-video-player/ ├── src/ │ ├── components/ # All modular player components │ ├── hooks/ # Custom video hook │ ├── types/ # Type definitions │ ├── styles/ # CSS styles │ └── index.ts # Entry point ├── demo/ # Vite + manual CSS demo project ├── dist/ # Compiled output ├── package.json ├── tsconfig.json └── README.md
You can override styling using CSS variables:
.rvp-video-player { --rvp-primary-color: #ff0000; --rvp-background-color: rgba(0, 0, 0, 0.8); --rvp-text-color: white; --rvp-border-radius: 8px; }
This package does NOT depend on:
react-playervideo.jshls.jsIt’s written with vanilla React, DOM APIs, and TypeScript — fully maintainable and modular.
We welcome feature suggestions, bug reports, and contributions!
MIT License
© 2025 – Arun
Made with ❤️ and TypeScript by Arun YT
If you like this project, please consider giving it a star ⭐ and leaving feedback through GitHub Issues.
Your support helps keep this project actively maintained and improved.
To help more developers find and benefit from this project, it’s being submitted to:
FAQs
A customizable React video player with no dependencies
We found that react-smart-video-player demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.