Fix media player collapsing after track ends or during queue transitions

The stream 'stopped' backend event was calling clearTrack() in both the
WebSocket handler (updateStreamStatusFromData) and the polling handler
(updateStreamStatus), which added the .idle class and collapsed the player
to zero height. This fired whenever audio ended naturally or when
transitioning between queue items (playQueueItem calls stopStream() to reset
backend state before loading the next track).

The explicit stop button (handleStop) already calls clearTrack() directly, so
the 'stopped' event handlers don't need to — and shouldn't.
pull/301/head
Broque Thomas 1 week ago
parent ce129010e1
commit 276f70ab9a

@ -3590,11 +3590,13 @@ async function updateStreamStatus() {
break;
case 'stopped':
// Handle stopped state
// Handle stopped state — do NOT clear track here; explicit stop (handleStop)
// calls clearTrack() directly. Clearing here collapses the player mid-playback
// when the backend transitions to 'stopped' after audio naturally ends or during
// queue track transitions.
console.log('🛑 Stream stopped');
stopStreamStatusPolling();
hideLoadingAnimation();
clearTrack();
break;
}
@ -3661,10 +3663,11 @@ function updateStreamStatusFromData(data) {
clearTrack();
break;
case 'stopped':
// Do NOT clear track here — explicit stop (handleStop) calls clearTrack() directly.
// Clearing here collapses the player after audio naturally ends or during queue transitions.
console.log('🛑 Stream stopped');
stopStreamStatusPolling();
hideLoadingAnimation();
clearTrack();
break;
}
}

Loading…
Cancel
Save