Skip to content

Version 2.0.0 of waveplayer

Latest
Compare
Choose a tag to compare
@michaeldzjap michaeldzjap released this 05 Jan 17:37
· 31 commits to develop since this release

The 2.0.0 version of waveplayer is basically a complete rewrite of the code base in TypeScript, including the public facing API. Hence, upgrading from 1.x to 2.x will not be a simple npm install waveplayer@latest only. The most noticeable changes will be documented below, but details likely will be missing.

Added

  • Strategies are a more flexible way instructing waveplayer how to resolve the amplitude data associated with an audio file. Currently 3 strategy types are available: data, JSON and Web Audio. The first two expect the amplitude data to be supplied in some form, whereas the Web Audio strategy may be used to compute the amplitude data at runtime. Although convenient it also has its drawbacks (see the README for more info).
  • It is possible to only use the view part of waveplayer now via the View class.
  • You can supply your own HTML audio element now to a player instance. This means that multiple player (or playlist) instances can share the same HTML audio element (#19).
  • A view example has been added.
  • A dedicated Playlist class has been added in favour of the WavePlayer#createPlaylist method in version 1.x.

Changed

Lots of (small) changes to the API. Too many to name here really. To learn what has changed it is probably most useful to look at the documentation and the examples.

Removed

  • All waveplayer events have been removed. At the time it seemed like a good idea, but in reality everything it did can just as well be accomplished using regular JavaScript events and listeners.

Fixed

  • In version 1.x any HTML audio element related errors occurring during the loading of an audio file weren't properly handled. This should be fixed in version 2.x.