Version 1.1.0 of waveplayer.js
Bug Fixes
- The
load()
method now waits for thewaveplayer:canplay
event to be fired before resolving. - Fix incorrectly setting data in
drawWave()
method
Features
- Two new getters have been added to the API:
currentTime
to get the current playback time (in seconds) of the currently loaded / playing track andduration
to get the total duration (in seconds) of the currently loaded / playing track. - A new option
useGradient
has been added to enable / disable drawing the waveform with a gradient (default is drawing with a gradient) - The
load()
function now takes a second optional argumentdata
. This can be used to pass in the data needed to draw the waveform as opposed to load it via JSON (still default). ThecreatePlaylist()
method now also accepts passing in an array of objects instead of an array of URL strings. Each object should contain anurl
property pointing to the audio URL and adata
property pointing to an array or object containing the waveform data associated with the audio URL.
Thanks to @thespice for suggesting the new features.