Fix play behaviour in track view

- Version switching now stops playback and resets UI state
- Playback must be started manually after version switch
- Added space key shortcut for play/pause toggle
- UI elements correctly reflect playback state

Fixes: Play/pause controls work correctly after version switching
Improves: User experience with keyboard shortcuts
This commit is contained in:
Mistral Vibe
2026-03-29 20:39:15 +02:00
parent 1179d9f063
commit e71c7fc3ad
2 changed files with 21 additions and 5 deletions

View File

@@ -39,10 +39,9 @@ export function useWaveform(
ws.on("ready", () => {
setIsReady(true);
options.onReady?.(ws.getDuration());
// Auto-play if previous version was playing
if (wasPlayingRef.current) {
ws.play();
}
// Reset playing state when switching versions
setIsPlaying(false);
wasPlayingRef.current = false;
});
ws.on("audioprocess", (time) => {