Skip to content

OmarAglan/LAS-Player

Repository files navigation

LAS Player - HTML5 Custom Video Player

HTML5 JavaScript Tailwind CSS Vite

A feature-rich, customizable HTML5 video player built with vanilla JavaScript and styled with Tailwind CSS. This project demonstrates how to build a modern media player from scratch, incorporating numerous features and UI/UX enhancements.

✨ Features

🎬 Playback Controls

  • Play/Pause - Toggle video playback
  • Rewind/Fast-Forward - Skip ±10 seconds
  • Progress Bar - Clickable & draggable with time tooltip (desktop)
  • Playback Speed - Select from 0.5x, 0.75x, 1x, 1.5x, 2x

🔊 Audio Controls

  • Volume Slider - Vertical slider appears on hover/tap
  • Mute Toggle - One-click mute/unmute
  • Volume Memory - Persists across sessions via localStorage

📺 Display Options

  • Fullscreen Mode - Immersive viewing experience
  • Picture-in-Picture (PiP) - Watch while multitasking

📝 Subtitles

  • WebVTT Support - Load and toggle .vtt subtitle files
  • Styled Captions - Custom styled subtitle display

📁 File Handling

  • Video Upload - Load any video file directly
  • Subtitle Upload - Load WebVTT subtitle files

⌨️ Keyboard Shortcuts

Key Action
Space / K Play/Pause
Left Arrow Rewind 10s
Right Arrow Forward 10s
M Mute/Unmute
F Toggle Fullscreen

📱 Mobile & Touch

  • Touch Optimized - Tap-to-show controls, touch-seek
  • Responsive Design - Adapts to all screen sizes
  • Control Auto-Hide - Controls fade when not in use

⚠️ Error Handling

  • Invalid file type detection
  • Video loading error messages
  • Graceful fallbacks

🚀 Getting Started

Prerequisites

  • Node.js (v16+)
  • npm or yarn

Clone the Repository

git clone https://github.com/OmarAglan/html-v-player.git
cd html-v-player

Installation

npm install
# or
yarn install

Run Development Server

npm run dev
# or
yarn dev

Navigate to http://localhost:5173 in your browser.

Build for Production

npm run build
# or
yarn build

This creates optimized static assets in the dist folder.

📂 Project Structure

LAS Player/
├── index.html          # Main HTML structure
├── main.js             # VideoPlayer class & logic
├── style.css           # Custom styles & Tailwind imports
├── package.json        # Dependencies & scripts
├── vite.config.js      # Vite configuration (if present)
├── tailwind.config.js  # Tailwind configuration
├── postcss.config.js   # PostCSS configuration
├── public/             # Static assets
│   └── vite.svg        # Favicon
└── dist/               # Production build output

🛠️ Tech Stack

  • HTML5 - Semantic markup & native video APIs
  • Vanilla JavaScript (ES6+) - Class-based architecture
  • Tailwind CSS - Utility-first styling
  • Vite - Fast development & build tool
  • Material Icons - UI icons

🌐 Live Demo

View Demo (may reflect an older version)

📜 License

This project is open source and available under the MIT License.

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.


Made with ❤️ by Omar Aglan

About

A feature-rich, customizable HTML5 video player

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published