Wavesurfer.js version 2

The new version features dependency injection and a dynamic plugin API. This became necessary to fully support module bundlers like webpack or browserify. (Before version 2 wavesurfer relied on a global library object)

Apart from this architectural change there have been a number of smaller changes and refactors:

  • The codebase now uses modern ES2015 language features.
  • Webpack/Babel has replaced grunt as build system
  • The multicanvas renderer is now the default, the monocanvas renderer has been removed to keep the library size small.

Current status

The version is stable and released. Due to the nature of the refactor (an integrated plugin system for adding, initialising and destroying of plugin instances) all plugins are somehow affected. Some plugins are still buggy when used with the dynamic plugin API.

Conventional use cases (i.e. cases where you just want to create an instance with some plugins – no dynamic adding or removing – should work just fine) (Below in the plugin API examples, this means 1. should already work, 2. and 3. don't yet always work in all situations and for all plugins)


npm install and then npm start – The library directory is exposed under http://localhost:8080

Generate the documention by running npm run doc – Tests can be run by calling npm run test

There are still lots of things which need doing. We are thankful for any help we can get. Please see right at the bottom of this page how you can help.

Things left to do

  • Wavesurfer.js (including plugins) is a fairly complex piece of software, that's why it's very important to have lots of people test it and file bugs!
  • Although the core library has been refactored and documented very thoroughly the changes in the plugin code have been very minimal. They still lack jsdoc style comments* and can still be optimised/need to be debugged for use by the dynamic plugin API (*This would be very useful since that would make them appear in the generated documentation.)
  • There are still some memory leaks (which is also true of the current version) – identifying and fixing them would make the whole library stabler.
  • In general a lot of issues are documentation issues in the sense that they crop up because stuff is undocumented. Documenting is a proactive way of stopping those issues from every cropping up. Correcting and writing documentation, writing tutorials and how tos and so on would be very cool!
Fork me on GitHub