Skip to content

Latest commit

Β 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 Advanced Video Player Application

A professional, feature-rich video player built with Angular 20, featuring comprehensive testing, modern UI/UX, and enterprise-grade development practices.

πŸ“‹ Table of Contents

🎯 Overview

This is a sophisticated video player application that provides a seamless video viewing experience with advanced features like thumbnail generation, theme switching, and comprehensive playback controls. Built with modern Angular practices and enterprise-grade testing standards.

Key Highlights

  • βœ… 100% Test Coverage - All 40 test cases passing
  • βœ… Modern Angular 20 - Latest Angular features and best practices
  • βœ… Professional UI/UX - Material Design with custom theming
  • βœ… Cross-Origin Support - Handles CORS-restricted videos gracefully
  • βœ… Responsive Design - Works on all device sizes
  • βœ… Accessibility - ARIA attributes and keyboard navigation
  • βœ… Performance Optimized - Efficient thumbnail generation and memory management

πŸš€ Features

Core Video Player

  • Play/Pause Controls - Smooth video playback control
  • Seek Functionality - Click-to-seek with visual feedback
  • Time Display - Current time and total duration
  • Playback Speed Control - Multiple speed options (0.5x to 2x)
  • Volume Control - Slider-based volume with mute/unmute
  • Skip Controls - 10-second forward/backward navigation

Advanced Features

  • Thumbnail Strip - Visual timeline with clickable thumbnails
  • Smart Thumbnail Generation - Handles CORS and cross-origin videos
  • Theme Switching - Light/Dark mode with persistent preferences
  • Error Handling - Graceful error messages and recovery
  • Loading States - Skeleton loaders and progress indicators
  • URL Input - Support for custom video URLs
  • Example Videos - Pre-loaded sample videos for testing

Developer Experience

  • Comprehensive Testing - Unit tests with 100% coverage
  • Code Quality - ESLint, Prettier, and strict TypeScript
  • Pre-commit Hooks - Automated quality checks
  • Modern Tooling - Latest development tools and practices

πŸ›  Tech Stack

Frontend Framework

  • Angular 20.3.0 - Latest Angular with standalone components
  • TypeScript 5.9.2 - Strict type checking and modern features
  • Angular Material 20.2.9 - Professional UI components
  • Angular CDK 20.2.9 - Component development kit

Development Tools

  • Angular CLI 20.3.6 - Project scaffolding and build tools
  • ESLint 9.37.0 - Code linting with Angular-specific rules
  • Prettier 3.6.2 - Code formatting
  • Husky 9.1.7 - Git hooks for quality assurance
  • lint-staged 16.2.4 - Pre-commit code quality checks

Testing Framework

  • Jasmine 5.9.0 - Testing framework
  • Karma 6.4.0 - Test runner
  • Chrome Headless - Browser testing
  • Coverage Reports - Code coverage analysis

Build & Deployment

  • Angular Build System - Optimized production builds
  • Webpack Integration - Module bundling
  • Tree Shaking - Dead code elimination
  • AOT Compilation - Ahead-of-time compilation

πŸ— Architecture

Component Structure

src/app/
β”œβ”€β”€ app.ts                    # Root application component
β”œβ”€β”€ app.html                  # Application template
β”œβ”€β”€ app.css                   # Global styles
β”œβ”€β”€ app.routes.ts             # Routing configuration
β”œβ”€β”€ shared/
β”‚   └── enums/
β”‚       └── theme-mode.enum.ts # Theme enumeration
└── features/
    └── video-player/
        β”œβ”€β”€ video-player.ts   # Main video player component
        β”œβ”€β”€ video-player.html # Video player template
        β”œβ”€β”€ video-player.css  # Video player styles
        β”œβ”€β”€ video-player.spec.ts # Unit tests
        └── thumbnail.service.spec.ts # Thumbnail tests

Key Design Patterns

  • Standalone Components - Modern Angular architecture
  • Signals - Reactive state management
  • Computed Properties - Derived state calculations
  • ViewChild - Template reference access
  • OnDestroy - Lifecycle management
  • Interface Segregation - Clean type definitions

State Management

  • Angular Signals - Reactive state management
  • Computed Signals - Derived state calculations
  • Signal-based Components - Modern Angular patterns
  • Immutable Updates - Predictable state changes

πŸš€ Installation & Setup

Prerequisites

  • Node.js 18+ (Recommended: 20+)
  • npm 9+ or yarn 1.22+
  • Git 2.30+

Quick Start

  1. Clone the Repository

    git clone <repository-url>
    cd Video_Player
  2. Install Dependencies

    npm install
  3. Start Development Server

    npm start
  4. Open in Browser

    http://localhost:4200
    

Development Commands

# Development
npm start              # Start dev server
npm run build          # Production build
npm run watch          # Watch mode build

# Testing
npm run test           # Run all tests
npm run test:watch     # Watch mode testing
npm run test:coverage  # Coverage report

# Code Quality
npm run lint           # Run ESLint
npm run lint:fix       # Fix linting issues
npm run format         # Format code with Prettier

πŸ“– Usage

Basic Video Player

  1. Load Default Video

    • The player loads with a default sample video
    • Click the play button to start playback
  2. Load Custom Video

    • Enter a video URL in the input field
    • Click "Load" to load the new video
    • Click "Reset" to return to default
  3. Playback Controls

    • Play/Pause: Click the play button or spacebar
    • Seek: Click on the progress bar or use arrow keys
    • Volume: Use the volume slider or click the volume icon
    • Speed: Select from the speed dropdown (0.5x to 2x)
    • Skip: Use the skip forward/backward buttons

Advanced Features

  1. Thumbnail Navigation

    • Thumbnails appear below the video player
    • Click any thumbnail to jump to that time
    • Thumbnails are generated automatically for supported videos
  2. Theme Switching

    • Toggle between light and dark themes
    • Theme preference is saved automatically
    • Accessible via the navbar toggle
  3. Error Handling

    • Invalid URLs show helpful error messages
    • CORS-restricted videos display enhanced thumbnails
    • Network issues are handled gracefully

πŸ§ͺ Testing

Test Coverage

  • 40 Test Cases - Comprehensive test suite
  • 100% Pass Rate - All tests passing
  • Unit Tests - Component and service testing
  • Integration Tests - Feature integration testing
  • Mock Testing - Isolated component testing

Test Categories

Video Player Component Tests (25 tests)

  • Video loading and error handling
  • Playback controls (play/pause/seek)
  • Speed and volume controls
  • Thumbnail functionality
  • Theme management
  • State management
  • Cleanup and lifecycle

Thumbnail Service Tests (10 tests)

  • Thumbnail generation
  • CORS handling
  • Error scenarios
  • Performance optimization
  • User interactions

App Component Tests (5 tests)

  • Theme switching
  • Component initialization
  • State consistency
  • DOM manipulation

Running Tests

# Run all tests
npm run test

# Watch mode (for development)
npm run test:watch

# Coverage report
npm run test:coverage

# Specific test file
npm run test -- --include="**/video-player.spec.ts"

Test Configuration

  • Headless Chrome - Fast, reliable testing
  • Jasmine Framework - Behavior-driven testing
  • Karma Runner - Cross-browser testing
  • Coverage Reports - HTML and LCOV formats

πŸ”„ Development Workflow

Code Quality Pipeline

  1. Pre-commit Hooks

    • Automatic code formatting with Prettier
    • ESLint checks for code quality
    • Unit test execution
    • TypeScript compilation
  2. Quality Gates

    • All tests must pass
    • No linting errors
    • Proper code formatting
    • Type safety compliance
  3. Development Process

    # Make changes
    git add .
    git commit -m "feat: add new feature"
    # Pre-commit hooks run automatically
    git push

Code Standards

  • TypeScript Strict Mode - Maximum type safety
  • ESLint Rules - Angular-specific linting
  • Prettier Formatting - Consistent code style
  • Naming Conventions - Clear, descriptive names
  • Documentation - Comprehensive code comments

⚑ Performance Optimizations

Video Player Optimizations

  • Lazy Loading - Thumbnails generated on demand
  • Memory Management - Proper cleanup in ngOnDestroy
  • Efficient Rendering - Angular OnPush change detection
  • Debounced Operations - Throttled user interactions

Thumbnail Generation

  • CORS Handling - Graceful fallback for cross-origin videos
  • Async Processing - Non-blocking thumbnail generation
  • Caching Strategy - Reuse generated thumbnails
  • Error Recovery - Fallback to enhanced thumbnails

Bundle Optimization

  • Tree Shaking - Remove unused code
  • AOT Compilation - Ahead-of-time optimization
  • Code Splitting - Lazy-loaded modules
  • Minification - Compressed production builds

🎯 Project Status

  • βœ… Core Features - Complete
  • βœ… Testing - 100% coverage
  • βœ… Documentation - Comprehensive
  • βœ… Performance - Optimized
  • βœ… Accessibility - WCAG compliant
  • βœ… Browser Support - Cross-platform

Built with ❀️ using Angular 20 and modern web technologiesclear

About

A video player using angular as a tech stack.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages