A custom media player built with vanilla HTML, CSS, and JavaScript. Features a modern dark theme with comprehensive media controls including playback speed, volume control, fullscreen mode, and picture-in-picture support.
- Node.js (version 14 or higher)
- npm
# Clone the repository
git clone <repository-url>
cd ott_player
# Install dependencies
npm install# Start development server
npm start
# or
npm run build:devThis will start a local server at http://localhost:54321
| Script | Description |
|---|---|
npm start |
Start development server |
npm run build |
Create production build |
npm run build:dev |
Start development server |
npm run build:prod |
Build and serve production version |
npm run clean |
Remove build directory |
npm test |
Run tests (placeholder) |
The build process includes:
- โ HTML file copying
- โ CSS minification (clean-css-cli)
- โ JavaScript minification (uglify-js)
- โ Asset optimization
- โ Favicon and sample video copying
- โ Build validation
# Create production build
npm run build
# Build output will be in ./dist/
ls -la dist/-
Enable GitHub Pages
- Go to repository Settings โ Pages
- Set Source to "GitHub Actions"
-
Automatic Deployment
- Push to
mainormasterbranch - GitHub Actions will automatically build and deploy
- Site will be available at:
https://yourusername.github.io/repository-name/
- Push to
-
Set up Netlify
- Create Netlify account
- Install Netlify CLI:
npm install -g netlify-cli
-
Configure Secrets
- Go to repository Settings โ Secrets and variables โ Actions
- Add
NETLIFY_AUTH_TOKEN(from Netlify dashboard) - Add
NETLIFY_SITE_ID(from Netlify site settings)
-
Deploy
- Push to
mainormasterbranch - GitHub Actions will automatically deploy to Netlify
- Push to
# Build the project
npm run build
# Deploy using various platforms:
# Surge.sh
npm install -g surge
surge dist/ your-domain.surge.sh
# Vercel
npm install -g vercel
vercel --prod
# Or upload the 'dist' folder to any web serverott_player/
โโโ .github/workflows/
โ โโโ ci-cd.yml # GitHub Actions workflow
โโโ data/
โ โโโ sample.mp4 # Sample video file
โโโ script/
โ โโโ media.js # Media player JavaScript
โโโ style/
โ โโโ media.css # Media player styles
โโโ dist/ # Build output (generated)
โโโ build.js # Build script
โโโ deploy-config.json # Deployment configurations
โโโ package.json # Project dependencies and scripts
โโโ index.html # Main HTML file
โโโ README.md # This file
- Modern UI: Dark theme with gradient header
- File Upload: Support for local video files
- URL Streaming: Play videos from web URLs
- Playback Controls:
- Play/Pause
- Skip forward/backward
- Volume control
- Playback speed adjustment
- Fullscreen mode
- Picture-in-Picture mode
- Video Effects:
- Cinema mode
- Vivid mode
- Black & White
- Night mode
- Trim Feature: Select and play specific video segments
- Auto-loop: Loop selected segments
- Responsive Design: Works on desktop and mobile
- Local Files: Use the file input to select local video files
- Web URLs: Paste video URLs in the URL input field
- Sample Video: Default sample video is included in
data/sample.mp4
- Colors: Modify CSS custom properties in
style/media.css - Controls: Add/remove controls in
index.html - Functionality: Extend features in
script/media.js
# Clear node modules and reinstall
rm -rf node_modules package-lock.json
npm install
# Clean build directory
npm run clean
npm run build- Ensure all files are committed to git
- Check GitHub Actions logs for errors
- Verify deployment secrets are correctly set
- Check browser console for errors
- Ensure video format is supported (MP4 recommended)
- Check CORS settings for external URLs
ISC License - see LICENSE file for details.
Biswasindhu Mandal
- GitHub: @artbindu
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Test the build:
npm run build - Commit changes:
git commit -am 'Add feature' - Push to branch:
git push origin feature-name - Submit a Pull Request
For support and questions:
- Create an issue on GitHub
- Check the troubleshooting section above
- Review GitHub Actions logs for deployment issues