Upgrading from wavesurfer.js version 1.x to 2.x

Wavesurfer.js version 2.x introduced 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.

Status

Version 2 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.

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.

Developing

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

Fork me on GitHub