Prerequisites: You need a Spotify Premium account to use the streaming features. Free accounts are not supported by Spotify's Web Playback SDK.
Widevine DRM Required: Your browser must support Widevine DRM for Spotify integration to work.
Modern browsers like Chrome, Firefox, Safari, and Edge support this by default. Older browsers or special configurations
might have Widevine disabled, which will prevent Spotify playback.
Step 1: Create a Spotify App
- Go to the Spotify Developer Dashboard
- Log in with your Spotify account
- Click "Create App"
- Fill in the app details:
- App name: nJukebox (or any name you prefer)
- App description: Digital jukebox system
- Website: http://localhost:3000 (or your domain)
- Redirect URI:
http://localhost:3000/spotify_login.html
- Accept the Terms of Service
- Click "Save"
📝 Example App Settings:
Name: nJukebox
Description: Digital jukebox with local and streaming music
Redirect URI: http://localhost:3000/spotify_login.html
Step 2: Get Your Client ID
- After creating the app, you'll see your app dashboard
- Click on your app name to view details
- Find the "Client ID" in the app settings
- Copy this Client ID (you'll need it in the next step)
Security Note: The Client ID is public and safe to share. Do NOT use or share the Client Secret for web applications.
Step 3: Configure nJukebox
- Start nJukebox and open the web interface
- Click the lock icon (🔒) and enter your admin PIN
- In the admin panel, click "⚙️ Konfiguration" next to Spotify settings
- Paste your Client ID in the input field
- Click "Speichern" (Save)
Configuration Complete! nJukebox is now configured to work with Spotify.
Step 4: Connect Your Spotify Account
- In the admin panel, click "Mit Spotify verbinden"
- You'll be redirected to Spotify's authorization page
- Log in with your Spotify Premium account
- Grant the requested permissions:
- Read your currently playing track
- Control playback on your devices
- Access your email and profile
- You'll be redirected back to nJukebox
- The Spotify status should show as connected (green dot)
Required Spotify Permissions
nJukebox requests the following Spotify scopes:
user-read-playback-state - Read your current playback state
user-modify-playbook-state - Control your playback
user-read-currently-playing - Read currently playing track
streaming - Play music on supported devices
user-read-email - Access your email address
user-read-private - Access your profile information
Using Spotify Features
Searching Spotify
Once connected, the search function will include Spotify results alongside your local music library.
Playing Spotify Tracks
- Search for any track, artist, or album
- Spotify results will show with a 🌐 badge
- Click any Spotify track to add it to your playlist
- The track will play through nJukebox
Mixed Playlists
You can create playlists that mix local MP3 files with Spotify tracks seamlessly.
Troubleshooting
Connection Issues
Common Issues:
- Redirect URI mismatch: Ensure the redirect URI in your Spotify app matches exactly:
http://localhost:3000/spotify_login.html
- Free account: Spotify Premium is required for playback features
- Browser blocking: Ensure popups are allowed for the nJukebox domain
Playback Issues
- No audio: Check that your browser allows audio playback
- Track skipping: Ensure you have a stable internet connection
- Authorization expired: Re-authorize in the admin panel if connection is lost
- Widevine DRM: Verify that Widevine DRM is enabled in your browser (chrome://settings/content/protectedContent or about:preferences#privacy in Firefox)
Token Refresh
Spotify tokens expire after 1 hour. nJukebox automatically refreshes them, but if you encounter authorization errors:
- Go to the admin panel
- Click the Spotify configuration button
- Re-authorize your account
Advanced Configuration
Custom Domain Setup
If you're running nJukebox on a custom domain:
- Update your Spotify app's redirect URI to:
https://yourdomain.com/spotify_login.html
- Ensure your domain uses HTTPS (required by Spotify)
- Update the website URL in your Spotify app settings
Multiple Instances
To run multiple nJukebox instances:
- Create separate Spotify apps for each instance
- Use different ports and redirect URIs
- Configure each instance with its own Client ID
Next Steps: Learn about
admin features and how to manage events with Spotify integration.
Spotify Premium erforderlich: Für die Spotify-Integration benötigen Sie ein Spotify Premium-Konto.
Kostenlose Spotify-Konten können die Web Playback API nicht nutzen.
Widevine DRM erforderlich: Ihr Browser muss Widevine DRM unterstützen, damit die Spotify-Integration funktioniert.
Moderne Browser wie Chrome, Firefox, Safari und Edge unterstützen dies standardmäßig. Bei älteren Browsern oder speziellen Konfigurationen
könnte Widevine deaktiviert sein, was die Spotify-Wiedergabe verhindert.
Warum Spotify integrieren?
Die Spotify-Integration erweitert Ihre nJukebox um Millionen von Songs und bietet:
- 🎵 Riesige Musikbibliothek: Zugriff auf über 50 Millionen Songs
- 🔍 Erweiterte Suche: Finden Sie jeden Song, Künstler oder Album
- 🤖 Auto-Learning: Automatisches Hinzufügen beliebter Playlists
- 🎯 Nahtlose Integration: Kombiniert mit Ihrer lokalen Musiksammlung
Voraussetzungen
- Spotify Premium Konto
- Laufende nJukebox-Installation
- Admin-Zugriff auf nJukebox
- Internetverbindung
Schritt 1: Spotify Developer App erstellen
- Gehen Sie zu developer.spotify.com/dashboard
- Melden Sie sich mit Ihrem Spotify-Konto an
- Klicken Sie auf "Create an App"
- App-Details eingeben:
- App Name: nJukebox (oder ein beliebiger Name)
- App Description: Digital Jukebox System
- Website: http://localhost:3000 (oder Ihre Domain)
- Redirect URI:
http://localhost:3000/spotify_login.html
- Akzeptieren Sie die Nutzungsbedingungen
- Klicken Sie auf "Speichern"
Wichtig: Die Redirect URI muss exakt http://localhost:3000/spotify_login.html lauten,
auch wenn Sie nJukebox später über das Netzwerk verwenden.
Schritt 2: Client ID kopieren
- Nach dem Erstellen sehen Sie Ihr App-Dashboard
- Klicken Sie auf Ihren App-Namen für Details
- Finden Sie die "Client ID" in den App-Einstellungen
- Kopieren Sie diese Client ID (Sie brauchen sie im nächsten Schritt)
Sicherheitshinweis: Die Client ID ist öffentlich und kann geteilt werden. Verwenden oder teilen Sie NICHT das Client Secret für Web-Anwendungen.
Schritt 3: nJukebox konfigurieren
- Starten Sie nJukebox und öffnen Sie die Web-Oberfläche
- Klicken Sie auf das Schloss-Symbol (🔒) und geben Sie Ihre Admin-PIN ein
- Im Admin-Panel klicken Sie auf "⚙️ Konfiguration" neben den Spotify-Einstellungen
- Fügen Sie Ihre Client ID in das Eingabefeld ein
- Klicken Sie auf "Speichern"
Konfiguration abgeschlossen! nJukebox ist jetzt für Spotify konfiguriert.
Schritt 4: Spotify-Konto verbinden
- Im Admin-Panel klicken Sie auf "Mit Spotify verbinden"
- Sie werden zur Spotify-Autorisierungsseite weitergeleitet
- Melden Sie sich mit Ihrem Spotify Premium-Konto an
- Gewähren Sie die angeforderten Berechtigungen:
- Aktuell abgespielte Titel lesen
- Wiedergabe auf Ihren Geräten steuern
- Zugriff auf E-Mail und Profil
- Sie werden zurück zu nJukebox weitergeleitet
- Der Spotify-Status sollte als verbunden angezeigt werden (grüner Punkt)
Benötigte Spotify-Berechtigungen
nJukebox fordert die folgenden Spotify-Scopes an:
user-read-playback-state - Aktuellen Wiedergabestatus lesen
user-modify-playbook-state - Wiedergabe steuern
user-read-currently-playing - Aktuell abgespielten Titel lesen
streaming - Musik auf unterstützten Geräten abspielen
user-read-email - Zugriff auf E-Mail-Adresse
user-read-private - Zugriff auf Profilinformationen
Spotify-Funktionen nutzen
Spotify durchsuchen
Sobald verbunden, enthält die Suchfunktion Spotify-Ergebnisse neben Ihrer lokalen Musikbibliothek.
Spotify-Titel abspielen
- Suchen Sie nach einem beliebigen Titel, Künstler oder Album
- Spotify-Ergebnisse werden mit einem 🌐 Badge angezeigt
- Klicken Sie auf einen Spotify-Titel, um ihn zur Playlist hinzuzufügen
- Der Titel wird über nJukebox abgespielt
Gemischte Playlists
Sie können Playlists erstellen, die lokale MP3-Dateien mit Spotify-Titeln nahtlos mischen.
Problembehandlung
Verbindungsprobleme
Häufige Probleme:
- Redirect URI stimmt nicht überein: Stellen Sie sicher, dass die Redirect URI in Ihrer Spotify-App exakt übereinstimmt:
http://localhost:3000/spotify_login.html
- Kostenloses Konto: Spotify Premium ist für Wiedergabefunktionen erforderlich
- Browser blockiert: Stellen Sie sicher, dass Pop-ups für die nJukebox-Domain erlaubt sind
Wiedergabeprobleme
- Kein Ton: Überprüfen Sie, dass Ihr Browser die Audio-Wiedergabe erlaubt
- Titel überspringen: Stellen Sie eine stabile Internetverbindung sicher
- Autorisierung abgelaufen: Autorisieren Sie erneut im Admin-Panel, wenn die Verbindung verloren geht
- Widevine DRM: Überprüfen Sie, dass Widevine DRM in Ihrem Browser aktiviert ist (chrome://settings/content/protectedContent oder about:preferences#privacy in Firefox)
Token aktualisieren
Spotify-Tokens laufen nach 1 Stunde ab. nJukebox erneuert sie automatisch, aber falls Autorisierungsfehler auftreten:
- Gehen Sie zum Admin-Panel
- Klicken Sie auf die Spotify-Konfigurationsschaltfläche
- Autorisieren Sie Ihr Konto erneut
Erweiterte Konfiguration
Custom Domain Setup
Wenn Sie nJukebox auf einer benutzerdefinierten Domain betreiben:
- Aktualisieren Sie die Redirect URI Ihrer Spotify-App auf:
https://ihredomain.com/spotify_login.html
- Stellen Sie sicher, dass Ihre Domain HTTPS verwendet (von Spotify erforderlich)
- Aktualisieren Sie die Website-URL in Ihren Spotify-App-Einstellungen
Mehrere Instanzen
Um mehrere nJukebox-Instanzen zu betreiben:
- Erstellen Sie separate Spotify-Apps für jede Instanz
- Verwenden Sie unterschiedliche Ports und Redirect URIs
- Konfigurieren Sie jede Instanz mit ihrer eigenen Client ID
Nächste Schritte: Erfahren Sie mehr über
Admin-Funktionen und wie Sie Events mit Spotify-Integration verwalten.