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:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user