A responsive Spotify-style web music player built using HTML, CSS, and JavaScript.
This project dynamically loads albums and songs either from a local server or a Cloudflare Worker API, allowing users to play, pause, seek, and adjust volume β all in a sleek, modern interface inspired by Spotify.
β
Dynamic Music Loading
Fetches songs and album info directly from local directories or via a worker endpoint.
β
Play / Pause / Next / Previous Controls
Full playback control with smooth transitions and time tracking.
β
Seekbar & Progress Tracking
Users can click the seekbar to jump to any part of the song.
β
Volume Control & Mute Toggle
Integrated volume slider and mute/unmute button.
β
Responsive UI
Works seamlessly on desktop, tablet, and mobile devices.
β
Dynamic Albums Display
Each album is generated from a folder containing songs, a cover image, and an info.json
file (with title & description).
β
Cloudflare Worker Support (Optional)
Play songs hosted remotely by connecting your Worker endpoint via the WORKER_URL
variable.
π project-root
β£ π css
β β£ π style.css # Main styles
β β π utility.css # Utility classes and helper styles
β£ π js
β β£ π script1.js # Uses Cloudflare Worker endpoint (WORKER_URL)
β β π script2.js # Uses local server (http://localhost:5500)
β£ π img # All icons and image assets
β£ π songs # Albums directory
β β£ π <album-name> # Each album folder
β β β£ π΅ <song-files> # Individual song files
β β β£ πΌοΈ cover.jpeg # Album cover
β β β π info.json # Album metadata
β£ π index.html # Main entry point
β π README.md # Project documentation
-
script1.js
β Connects to a Cloudflare Worker API
β Fetches album & song data from the worker link you provide inWORKER_URL
. -
script2.js
β Works with a Local Server
β Scans directories like/songs/album-name
to list and play songs. -
Each album folder should contain:
cover.jpeg
β Album coverinfo.json
β Album info.mp3
files β Songs
Example info.json
:
{
"title": "Chill Vibes",
"discription": "Relax and enjoy smooth chill beats."
}
- Clone this repository:
git clone https://github.com/yourusername/spotify-music-player.git
- Start a local server (e.g., with VSCodeβs Live Server or Python):
npx serve
or
python -m http.server 5500
-
Open your browser and go to: http://localhost:5500/
-
Add your songs and albums inside the /songs folder.
If you want to stream songs from a remote server:
- Deploy a Worker API that returns:
-
/api/albums
-
/api/songs/{album} and serves song files from /songs/{album}/.
- In script1.js, set:
const WORKER_URL = "https://your-worker-link.workers.dev";
- Run the web app normally β your music will load remotely.
-
HTML5
-
CSS3 (Responsive Design)
-
JavaScript (ES6)
-
Cloudflare Workers (optional for remote hosting)
- This project is open-source under the MIT License.
- You are free to use, modify, and distribute it.
- Made by : MS Coder with π
- π¬ Front-End Developer & JavaScript Enthusiast
- π§ [ms.coder.py@gmail.com]
- π [https://ms-coder-project.netlify.app/]