katspaugh/wavesurfer.js — pull request #225 by rgagnon24 (2014-08-21 20:04:16+00:00)
Title: Re-add working 'finish' event, fix missing initialization, ensure 100% loading event

'finish' event was removed a while back from master, due to odd interactions apparently. I've found a way that it seems to work reliably, ensuring a working 'buffer' is available for getDuration() to work with, and also setting a flag to ensure that 'finish' does not continuously fire at the end of audio.

lastPause was not being properly initialized during a load() call. The variable lastPlay was inadvertently being set twice.

During ajax load of audio, 100% progress was not always guaranteed to fire. Sometimes it does, sometimes it does not. The patch for this watches "progress" to see if a 100% condition did fire, and then, during "load", it will fire off a "progress" if a 100% notification never happened. This ensures users watching for "progress" events will get a 100% loaded event.