Skip to content

🎬 Simple, lightweight media player built with Python & PyQt6. Cross-platform video player with modern UI, fullscreen mode, variable playback speeds, and subtitle support. Perfect for developers learning GUI programming!

License

Notifications You must be signed in to change notification settings

ArjunBiswas-99/simple-media-player-v1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

90 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎬 Simple Media Player

by Arjun Biswas

Python Version PyQt6 License: MIT Platform

A modern, lightweight, cross-platform video player built with Python and PyQt6. Perfect for developers learning GUI programming or users seeking a simple, elegant media player.

✨ Why Simple Media Player?

  • πŸš€ Zero configuration - Works out of the box with system codecs
  • 🎨 Beautiful UI - Modern dark/light themes with smooth animations
  • ⚑ Lightweight - Pure Python, no heavy dependencies
  • πŸ”„ Cross-platform - Windows, macOS, and Linux support
  • πŸŽ“ Clean code - Well-structured, perfect for learning PyQt6
  • πŸ†“ Open source - Free to use, modify, and learn from

πŸ“Έ Screenshots

Dark Theme

Modern dark interface perfect for nighttime viewing image

Light Theme

Clean, professional light mode for daytime use image

🎯 Key Features

πŸŽ₯ Media Playback

  • βœ… Universal format support - MP4, MKV, AVI, MOV, WMV, FLV, WebM, and more
  • βœ… Hardware acceleration - Uses native OS media frameworks
  • βœ… Perfect sync - Audio and video perfectly synchronized
  • βœ… Variable speed - 0.5x to 2.0x playback with pitch preservation
  • βœ… Subtitle support - SRT, ASS, SSA formats

🎨 Modern User Interface

  • πŸŒ™ Dark/Light themes - Professional color schemes
  • πŸ–±οΈ Intuitive controls - Click-to-seek, drag-and-drop support
  • πŸ–ΌοΈ Smart fullscreen - Auto-hiding controls, mouse-activated
  • πŸ“ Auto-resize - Window adapts to video resolution
  • 🎯 Responsive - Smooth, lag-free interface

⌨️ Power User Features

  • ⚑ Keyboard shortcuts - Complete keyboard control
  • πŸ”„ Fast forward - Click and hold to skip ahead
  • 🎚️ Volume control - Precise volume adjustment
  • ⏯️ Playback control - Play, pause, stop, seek
  • πŸ–ΌοΈ Click-to-seek - Jump anywhere instantly

πŸ“₯ Download & Installation

Option 1: Windows Executable (Easiest!) ⭐

No Python installation required!

  1. Go to Releases
  2. Download SimpleMediaPlayer.exe
  3. Double-click to run
  4. That's it! πŸŽ‰

Option 2: From Source (macOS/Linux/Windows)

Prerequisites:

  • Python 3.10 or higher
  • pip (Python package installer)

Installation Steps:

Download from Release:

  1. Go to Releases
  2. Download Source code (zip)
  3. Extract the ZIP file
  4. Open Terminal/Command Prompt in the extracted folder
  5. Install dependencies:
    pip install -r requirements.txt
  6. Run the player:
    # Windows
    python -m src.main
    
    # macOS/Linux
    python3 -m src.main

Or Clone from Git:

git clone https://github.com/ArjunBiswas-99/simple-media-player.git
cd simple-media-player
pip install -r requirements.txt
python -m src.main

Opening a Video

Method 1: Drag and Drop

  • Simply drag a video file onto the player window

Method 2: File Menu

  • Click File β†’ Open File (or press Ctrl+O)

Method 3: Command Line

python -m src.main "path/to/video.mp4"

⌨️ Keyboard Shortcuts

Playback Controls

Shortcut Action
Space Play/Pause
S Stop
← / β†’ Seek backward/forward (5 seconds)
↑ / ↓ Volume up/down
M Mute/Unmute

Display Controls

Shortcut Action
F Toggle fullscreen
Esc Exit fullscreen
Ctrl+O Open file
Ctrl+S Open subtitle
Ctrl+Q Quit

Mouse Controls

Action Result
Click progress bar Seek to position
Double-click video Toggle fullscreen
Click and hold video Fast forward (2x speed)
Mouse move (fullscreen) Show controls

πŸ—οΈ Building Executable

Create a standalone application:

Windows:

python scripts/build.py

Output: dist/PyMediaPlayer.exe

Cross-platform:

pip install pyinstaller
pyinstaller --name="Simple Media Player" --windowed src/main.py

πŸ”§ Technology Stack

Core Technologies

  • PyQt6 - Modern Qt6 bindings for Python
  • PyQt6-Multimedia - Native multimedia framework
  • Python 3.10+ - Latest Python features

Architecture Highlights

  • πŸ›οΈ Clean Architecture - Separation of concerns, SOLID principles
  • 🧩 Modular Design - Independent components with clear interfaces
  • πŸ”’ Thread-safe - Proper synchronization for multimedia
  • πŸ“ Well-documented - Comprehensive code comments

How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        PyQt6 Application           β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  GUI (main_window.py)              β”‚
β”‚   β”œβ”€ Video Widget (video_widget.py)β”‚
β”‚   β”œβ”€ Controls & UI                 β”‚
β”‚   └─ Theme Manager                 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Media Player (player.py)          β”‚
β”‚   β”œβ”€ QMediaPlayer (Qt Multimedia)  β”‚
β”‚   β”œβ”€ QAudioOutput (System audio)   β”‚
β”‚   └─ QVideoSink (Video rendering)  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Native OS Media Frameworks        β”‚
β”‚   β”œβ”€ Windows: Media Foundation     β”‚
β”‚   β”œβ”€ macOS: AVFoundation           β”‚
β”‚   └─ Linux: GStreamer              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Why PyQt6 Multimedia?

  • βœ… Uses native OS codecs (no external libraries needed)
  • βœ… Hardware acceleration support
  • βœ… Perfect audio/video synchronization
  • βœ… Same technology used by professional Qt applications
  • βœ… Simple, unified API for all media types

πŸ“ Project Structure

simple-media-player/
β”œβ”€β”€ README.md                    # Project documentation
β”œβ”€β”€ LICENSE                      # MIT License
β”œβ”€β”€ requirements.txt             # Python dependencies
β”‚
β”œβ”€β”€ src/                         # Source code
β”‚   β”œβ”€β”€ main.py                  # Application entry point
β”‚   β”œβ”€β”€ core/
β”‚   β”‚   └── player.py            # Media playback engine
β”‚   └── gui/
β”‚       β”œβ”€β”€ main_window.py       # Main window & UI
β”‚       β”œβ”€β”€ video_widget.py      # Video display widget
β”‚       β”œβ”€β”€ theme_manager.py     # Theme management
β”‚       └── fullscreen_overlay.py # Fullscreen controls
β”‚
β”œβ”€β”€ docs/                        # Documentation
β”‚   β”œβ”€β”€ CHANGELOG.md             # Version history
β”‚   β”œβ”€β”€ CONTRIBUTING.md          # Contribution guidelines
β”‚   └── development/             # Developer docs
β”‚       β”œβ”€β”€ HOW_TO_RELEASE.md    # Release process
β”‚       └── RELEASE_NOTES_v1.0.0.md
β”‚
β”œβ”€β”€ scripts/                     # Build & utility scripts
β”‚   β”œβ”€β”€ build.py                 # Executable builder
β”‚   └── BUILD-EXE.bat            # Windows build script
β”‚
└── archive/                     # Archived files
    β”œβ”€β”€ errorlog.txt
    └── media-player-requirements.md

πŸ› Troubleshooting

Installation Issues

"No module named 'PyQt6'"

pip install --upgrade pip
pip install PyQt6 PyQt6-Multimedia

Python version error

python --version  # Must be 3.10 or higher

Playback Issues

Video plays but no audio

  • βœ… Check PyQt6-Multimedia is installed: pip show PyQt6-Multimedia
  • βœ… Verify video file has an audio track (test with another media player)
  • βœ… Check volume slider and mute button (press M to unmute)
  • βœ… Restart the application

Video won't load

  • βœ… Check file format is supported (MP4, MKV work best)
  • βœ… Look for error messages in terminal
  • βœ… Try a different video file
  • βœ… Ensure file isn't corrupted

Controls hidden in fullscreen

  • βœ… Move mouse to show controls
  • βœ… Controls auto-hide after 3 seconds
  • βœ… Press Esc or double-click to exit fullscreen

πŸ§ͺ Testing

Simple Media Player has comprehensive unit and integration tests.

Run Tests

# Install dev dependencies
pip install -r requirements-dev.txt

# Run all tests
pytest

# Run with coverage
pytest --cov=src --cov-report=html

Test Structure

  • Unit Tests (tests/unit/) - Test isolated components
  • Integration Tests (tests/integration/) - Test component interaction
  • Coverage Target - 70%+ overall coverage

See tests/README.md for detailed testing documentation.

🀝 Contributing

Contributions are welcome! See docs/CONTRIBUTING.md for guidelines.

Quick start:

  1. 🍴 Fork the repository
  2. 🌟 Create a feature branch (git checkout -b feature/AmazingFeature)
  3. πŸ’Ύ Commit your changes (git commit -m 'Add some AmazingFeature')
  4. πŸ“€ Push to the branch (git push origin feature/AmazingFeature)
  5. πŸŽ‰ Open a Pull Request

Development Setup

# Clone your fork
git clone https://github.com/YOUR_USERNAME/simple-media-player.git
cd simple-media-player

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt

# Run tests
pytest

# Run the application
python -m src.main

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

🌟 Star History

If you find this project useful, please consider giving it a star! ⭐

πŸ“¬ Contact & Support

πŸ™ Acknowledgments

  • PyQt6 team for excellent Python bindings
  • Qt Project for the robust multimedia framework
  • Open source community for inspiration and support

Made by Arjun Biswas

⬆ Back to Top

About

🎬 Simple, lightweight media player built with Python & PyQt6. Cross-platform video player with modern UI, fullscreen mode, variable playback speeds, and subtitle support. Perfect for developers learning GUI programming!

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published