A simple, lightweight web app for creating a collaborative YouTube music queue. Inspired by Spotify's Jam feature, this app allows multiple users to add YouTube links to a shared queue while playback remains centralized to the host. Ideal for group listening sessions where only YouTube is available.
- Collaborative Queue: Anyone with access to the app can add YouTube music links to the queue.
- Centralized Playback: Only the host (who knows the password) can control playback—play, pause, next song.
- Real-Time Queue Updates: The queue refreshes every 30 seconds automatically, or you can manually refresh it to see updates on-demand.
- Password Protection: Playback controls and are protected by a host-defined password to maintain centralized control.
- Lightweight Design: Simple UI, no unnecessary bloat.
- Video Information: Thumbnails are displayed automatically, and video titles are shown when a YouTube Data API key is configured.
This app is meant for group music sessions where YouTube is the primary platform. It provides a quick and rough alternative to Spotify's collaborative features when YouTube is your go-to music service.
That said, if you're using this app alone or stumbled upon it accidentally, you might not find much use for it—you could simply make your own YouTube playlist or manually queue songs in the YouTube app.
- A web server with PHP support (e.g., Apache, Nginx).
- A browser that supports modern JavaScript.
- (Optional) YouTube Data API key for displaying video titles.
-
Clone this repository:
git clone https://github.com/tsdiokno/ytm4.git
-
Place the files in your web server's root directory.
-
Ensure the following files and folders are writable:
queue.json(for saving the queue state).
-
(Optional) Create a
config.jsonfile in the root directory with the following structure to enable video titles:{ "youtube_api_key": "YOUR_API_KEY" }Replace
YOUR_API_KEYwith your actual YouTube Data API key. You can get one from the Google Cloud Console. Without this, the app will still work but will only show video URLs and thumbnails. -
Start your server and navigate to the app in your browser.
- Open the app in your browser.
- Enter the host password (default:
12345) to unlock playback controls. - Connect the audio output to a speaker system for centralized playback.
- Open the app in your browser (ensure you're on the same network as the host).
- Add YouTube links to the queue.
- Watch the queue update in real time and enjoy the music!
-
Frontend:
- Built with HTML, CSS, and vanilla JavaScript.
- Uses the YouTube IFrame Player API for video playback.
-
Backend:
- Written in PHP to handle queue management (
save_queue.php,get_queue.php). - The queue state is stored in a
queue.jsonfile.
- Written in PHP to handle queue management (
-
Queue Updates:
- Automatically refreshed every 30 seconds via JavaScript.
- Manual refresh available for on-demand updates.
- Development Mode Issues: The YouTube IFrame Player API may block playback in non-production environments due to YouTube's restrictions. Make sure you run this app on a production server for it to work properly.
- Basic Implementation: The app is intentionally kept simple. Advanced features like server-side updates, more robust APIs, or complex metadata scraping are not implemented but can be added by forking the project.
This project is licensed under the GNU General Public License v3.0 (GPL-3.0).
We welcome contributions! Here's how you can help:
- Fork the repository.
- Create a feature branch (
git checkout -b feature-name). - Commit your changes (
git commit -m 'Add feature'). - Push to your branch (
git push origin feature-name). - Open a pull request.
This app was created by @tsdiokno, a designer with limited coding experience, with the help of ChatGPT. The project intentionally sticks to the basics but serves as a functional example of a collaborative YouTube queue.
Feel free to fork and enhance the app with features like more advanced API usage, server-side updates, and metadata scraping.
If you use this app alone, it's no different from manually queuing songs in YouTube or creating a playlist. This app works best in group settings where the host controls playback, and everyone else contributes to the queue.
Enjoy the music! 🎶
