The Next-Gen Self-Hosted Media Streaming Server.
Material 3 β’ Liquid Glass β’ Nothing OS Design
WebPlay is a powerful, lightweight, and aesthetically stunning media player that turns your PC into a local streaming server. Built with Python and Flask, it allows you to stream your video and audio collections to any device on your network (Mobile, Tablet, Smart TV, or Laptop) via a web browser.
It combines the functionality of advanced players like MX Player Pro with the ease of a web interface, wrapped in a beautiful UI inspired by Nothing OS and Glassmorphism.
GitHub Repository: https://github.com/rkriad585/WebPlay
WebPlay acts as a bridge between your local file system and your web browser.
- Scanning: When you start the app, it scans the directory you specify.
- Hosting: It starts a local web server (using Flask).
- Transcoding:
- Native Play: Files like
.mp4and.webmare streamed directly to the browser with zero latency. - On-the-Fly Transcoding: Unsupported formats (like
.mkv,.avi,.flv) are converted in real-time using FFmpeg pipes, so you can watch anything without converting files manually.
- Native Play: Files like
- Remote Control: It opens a WebSocket connection, allowing you to use your smartphone as a remote control for the player running on your PC.
- Modern Aesthetics: A blend of Material 3 Expressive, Liquid Glass (Blur effects), and Nothing OS (Dot matrix fonts).
- Fully Responsive: Looks like a native app on Mobile, Tablet, and Desktop.
- Format Support: Plays
.mp4,.mkv,.avi,.mov,.flv,.webm,.mp3,.wav,.flac. - Smart Resume: Remembers exactly where you left off, even if you close the browser (SQLite Database).
- Audio Tracks: Select between multiple audio languages (e.g., English/Japanese) directly in the player.
- Subtitles: Auto-converts
.srtfiles to WebVTT for browser compatibility. - Picture-in-Picture: Watch media while multitasking.
- Binge Mode: Automatically plays the next episode in the folder.
- Remote Control: Scan a code/visit a link to control volume, seek, and play/pause from your phone.
- Watch Party: Sync playback with other devices on the network.
- Folder View: Browse media by folders (like MX Player) or a flat list.
- Smart Search: Instantly filter videos by name.
- Hardware Acceleration: Utilizes FFmpeg hardware capabilities where available.
Here is how the project is organized.
WebPlay/
βββ app.py # π The Main Application Entry Point (Routes & Logic)
βββ config.py # βοΈ Configuration settings & Path persistence
βββ requirements.txt # π¦ List of Python dependencies
βββ static/
βΒ Β βββ images
βΒ Β βββ logo.svg # π¨ Project Logo
βββ core/ # π§ Core Logic Module
β βββ media.py # Media scanning, Metadata extraction, Thumbnails
β βββ utils.py # Styling, Logging, and Helper functions
βββ templates/ # π₯οΈ HTML Frontend
βββ base.html # Base layout (Navbar, Footer, CSS imports)
βββ error.html # Beautiful "Access Denied" page
βββ index.html # Home Gallery (Grid/List/Folder views)
βββ player.html # Video Player interface
βββ remote.html # Mobile Remote Control interface
- Python 3.8+: Ensure Python is installed.
- FFmpeg: This is crucial. WebPlay uses FFmpeg for metadata and transcoding.
- Windows: Download and add to System PATH.
- Linux:
sudo apt install ffmpeg - Termux:
pkg install ffmpeg
-
Clone the Repository
git clone https://github.com/rkriad585/WebPlay.git cd WebPlay -
Install Dependencies
pip install -r requirements.txt
WebPlay is controlled via the Command Line Interface (CLI).
Tell WebPlay where your videos/music are located.
python app.py path "C:/Users/Name/Videos"
# Or on Linux/Termux
python app.py path "/storage/emulated/0/Movies"Starts the server with a randomly generated API Key. Only users with the link can access files.
python app.py startOutput:
[INFO] Server starting at: http://127.0.0.1:5000?key=xxxxx-xxxxx
[WARNING] Keep this key secret! Copy the full URL above.
Starts the server without password protection. Useful for home LAN.
python app.py freeOutput:
[INFO] Server starting at: http://127.0.0.1:5000
You can specify a port (default is 5000).
python app.py free --port 8080- Database: Playback progress is stored in
webplay.db(SQLite) automatically created in the root folder. - Cache: Thumbnails are cached in
.webplay_cache/to speed up loading times. - Settings: The last used folder path is saved in
webplay_settings.json.
To reset the app, simply delete webplay.db and webplay_settings.json.
Contributions are welcome! If you have ideas for new features or found a bug:
- Fork the repository.
- Create a new branch (
git checkout -b feature/AmazingFeature). - Commit your changes (
git commit -m 'Add some AmazingFeature'). - Push to the branch (
git push origin feature/AmazingFeature). - Open a Pull Request.
If you encounter any issues, please check the Issues tab.
I love building open-source tools! Connect with me on social media:
| Platform | Username | Link |
|---|---|---|
| GitHub | @rkriad585 | github.com/rkriad585 |
| YouTube | @rkriad585 | youtube.com/@rkriad585 |
| @rkriad585 | facebook.com/rkriad585 | |
| X (Twitter) | @rk_riad585 | x.com/rk_riad585 |
| @rkriad585 | instagram.com/rkriad585 | |
| Threads | @rkriad585 | threads.net/@rkriad585 |
| rkriad585 | rkriad585@gmail.com |
This project is distributed under the MIT License. You are free to use, modify, and distribute this software.
Copyright (c) 2024 RK Riad
Permission is hereby granted, free of charge, to any person obtaining a copy of this software...
Made with β€οΈ by RK Riad