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.
This commit is contained in:
parent
ce129010e1
commit
276f70ab9a
1 changed files with 6 additions and 3 deletions
|
|
@ -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…
Reference in a new issue