Skip to content

About

Web-Based Media Remote Control designed to run on a Windows computer. It creates a local web server that allows you to control your computer's media playback (like Spotify, Apple Music, YouTube in a browser, etc.) and system volume from any other device on the same local network via a clean, modern web browser interface.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Media Remote Control Web App

1. What is this App/Program?

This application is a Web-Based Media Remote Control designed to run on a Windows computer. It creates a local web server that allows you to control your computer's media playback (like Spotify, Apple Music, YouTube in a browser, etc.) and system volume from any other device on the same local network (such as your smartphone, tablet, or another laptop) via a clean, modern web browser interface.

It also features a live synced lyrics viewer, grabbing the lyrics for whatever song is currently playing on your PC.

2. How Does It Work?

  • Backend (Python/Flask): The Python script uses a micro web-framework called Flask to host a local web server on port 5001. It provides various API endpoints (/nowplaying, /volume, /playpause, etc.).
  • System Integration:
    • It hooks into the Windows OS using the winsdk library to fetch the globally playing media (title, artist, album art, and timestamp).
    • It uses pycaw to read and control the Windows master volume.
    • It uses pyautogui to simulate physical keyboard media button presses (Play/Pause, Next Track, Previous Track).
  • Frontend (HTML/CSS/JS): When you navigate to the app's IP address, the server sends a single HTML page. The JavaScript on this page continuously polls the /nowplaying API every 3 seconds to update the album art, track name, and current time. It also fetches lyrics dynamically from an external API (lrclib.net).

3. Workflow

  1. You run the script (prj.py) on your Windows PC.
  2. The script starts a web server accessible on your local network.
  3. You open a web browser on your phone and enter your PC's local IP address with port 5001 (e.g., http://192.168.1.15:5001).
  4. The web interface loads, showing the song currently playing on your PC.
  5. You can tap the play/pause buttons, adjust the volume slider, or open the lyrics view. These actions send HTTP requests back to the Python script.
  6. The Python script translates those HTTP requests into actual system commands on your PC.

4. Tech Stack Used

  • Language: Python 3.x
  • Web Framework: Flask
  • System Control Libraries:
    • winsdk (Windows SDK for Python) - To read what media is currently playing.
    • pycaw (Python Core Audio Windows Library) - To control system volume.
    • pyautogui - To simulate keyboard media key presses.
  • Frontend: HTML5, CSS3, Vanilla JavaScript.
  • External API: lrclib.net (for fetching song lyrics).

5. Requirements

  • A computer running Windows 10 or Windows 11 (since it relies heavily on Windows-specific libraries).
  • Python 3.x installed.
  • Both devices (the Windows PC running the script and the device controlling it) must be connected to the same Wi-Fi/local network.

6. Installation & Setup Process

Step 1: Install Python

If you haven't already, download and install Python from python.org. Make sure to check the box that says "Add Python to PATH" during installation.

Step 2: Install Required Libraries

Open your terminal or command prompt (cmd) and run the following command to install the required Python packages:

pip install Flask pyautogui winsdk pycaw

Step 3: Run the Application

Navigate to the folder containing remote.py` and run the script:

python remote.py

You should see output indicating that the Flask server is running on 0.0.0.0:5001.

Step 4: Find Your Local IP Address

To access the app from your phone, you need your PC's local IP address:

  1. Open Command Prompt on your PC.
  2. Type ipconfig and press Enter.
  3. Look for the IPv4 Address under your active network adapter (it usually looks like 192.168.x.x or 10.0.x.x).

Step 5: Connect and Control

  1. Open a web browser on your smartphone or tablet.
  2. In the address bar, type your PC's IP address followed by :5001. Example: http://192.168.1.15:5001
  3. You should now see the remote control interface. Play a song on your PC (e.g., on Spotify) and the app will update to show the current track and allow you to control it!

About

Web-Based Media Remote Control designed to run on a Windows computer. It creates a local web server that allows you to control your computer's media playback (like Spotify, Apple Music, YouTube in a browser, etc.) and system volume from any other device on the same local network via a clean, modern web browser interface.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages