modified: app.py
modified: templates/quiz.html
This commit is contained in:
@@ -144,11 +144,14 @@
|
||||
}
|
||||
// Starte Wiedergabe an gewünschter Stelle
|
||||
fetch(`/play_track?device_id=${device_id}&track_uri={{ track.uri }}&position_ms=${position_ms}`, { method: 'POST' })
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.error === "device_not_found") {
|
||||
alert(data.message || "Spotify-Player nicht gefunden. Die Seite wird neu geladen...");
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
return response.json();
|
||||
// ...bisheriger Code...
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error starting playback:', error);
|
||||
|
||||
Reference in New Issue
Block a user