naomiaro / waveform-playlist

Multitrack Web Audio editor and player with canvas waveform preview. Set cues, fades and shift multiple tracks in time. Record audio tracks or provide audio annotations. Export your mix to AudioBuffer or WAV! Add effects from Tone.js. Project inspired by Audacity.
https://naomiaro.github.io/waveform-playlist/
MIT License
1.47k stars 287 forks source link

Unable to drag annotations when automatic scroll is enabled #211

Open p-himik opened 2 years ago

p-himik commented 2 years ago

To reproduce:

  1. Go to https://naomiaro.github.io/waveform-playlist/annotations.html
  2. Enable Automatic Scroll at the bottom
  3. Scroll the waveform so it's not at the starting position
  4. Try dragging any annotation

Observed behavior: the waveform scrolling position is reset back to 0. Expected behavior: the scrolling should not be affected at all by starting annotation dragging. Ideally, dragging an annotation close to a boundary of the player would scroll the waveform in the correct direction, but this probably deserves a separate feature request.

The root cause is that ScrollHook changes the position even when the playlist.isPlaying() is false, without any additional checks.