wavesurfer.js
wavesurfer.js copied to clipboard
Feat: add error event
Short description
Adds support for wavesurfer.on('error') event. This is helpful when building components where the file source is unknown at build time and you might want to hook into that event to display an error message.
Implementation details
It catches errors thrown by "Fetcher.fetchBlob" and emits it as an event named error
How to test it
yarn test -- --spec ./cypress/e2e/error.cy.js
Screenshots
Checklist
- [x] This PR is covered by e2e tests
- [ ] It introduces no breaking API changes
I think it's likely that this introduces a breaking API change if users previously relied on
.createthrowing an exception which is now caught and reported by.on('error').
One of the tests seems to be failing on this branch.