katspaugh/wavesurfer.js — pull request #276 by naomiaro (2014-10-26 02:07:25+00:00)
Title: Seekto

These changes should solve bugs #245 and #200.

I've found working with webaudio in the past, there is a need for states to group logic together. A seekTo method is now used in the backend to move the cursor around. "play" and "pause" events are now only fired from the wavesurfer class since it was not needed from the backend. This gives better control for firing the events. The finish state will fire the "finish" event once upon entry. Fixing #200, I found when wavesurfer gets the "finish" event it was easiest to fire a "progress" event there passing in 1 to avoid any rounding and ensure the complete drawing.