Skip to content

Version 1.1.0 of waveplayer.js

Compare
Choose a tag to compare
@michaeldzjap michaeldzjap released this 11 Jul 15:38
· 175 commits to develop since this release

Bug Fixes

  • The load() method now waits for the waveplayer: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 and duration 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 argument data. This can be used to pass in the data needed to draw the waveform as opposed to load it via JSON (still default). The createPlaylist() method now also accepts passing in an array of objects instead of an array of URL strings. Each object should contain an url property pointing to the audio URL and a data property pointing to an array or object containing the waveform data associated with the audio URL.

Thanks to @thespice for suggesting the new features.