Releases: michaeldzjap/waveplayer
Releases · michaeldzjap/waveplayer
Version 2.0.0 of waveplayer
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 theWavePlayer#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.
Version 1.2.4 of waveplayer.js
Changed
Update dependencies and fix security alerts.
Version 1.2.3 of waveplayer.js
Changed
Fresh build after updating dependencies.
Version 1.2.2 of waveplayer.js
Changed
- A clean build after updating all dependencies
Version 1.2.1 of waveplayer.js
Bug Fixes
- Fix a bad reference (typo) to the canvas element when removing the click handler. Thanks to @axis80.
Version 1.2.0 of waveplayer.js
Features
- Two new public methods have been added:
loadAudio()
to load an audio file only, without loading and rendering the waveform view andloadWaveform()
to load and render the waveform view without loading the audio file. Use case could be where one would like to load multiple waveform views on a page, but defer loading of all audio (or vice versa). - It is now possible to specify the preload attribute of the HTML audio element as an option. Previously this was hardcoded to "auto", now it defaults to "metadata".
See the README for more details
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.
Version 1.0.4 of waveplayer.js
- Fix an issue where error is thrown due to bar data not being available yet
- Update dev dependencies
- Add more elaborate linting
Version 1.0.2 of waveplayer.js
Maintenance + small improvements.
Version 1.0.1 of waveplayer.js
Bump version