fireworks-js
fireworks-js copied to clipboard
wait until the last minute to load sounds
Checklist
- [ ] run
pnpm format
- [ ] documentation is changed or added
- [X] commit message and code follows the Developer's Certification of Origin and the Code of conduct
Feel free to reject this or change it. It's untested as I can't get the project to build/compile. On my JavaScript version I had to separate out the initialization of audioContext in order for the sound to work on the first firework, like this.
init() {
if (this.audioContext == null) {
this.audioContext = new (window.AudioContext || window.webkitAudioContext)();
this.loadSounds();
}
if (!this.onInit && this.isEnabled) {
this.onInit = true;
}
}
but it looks like what I committed in typescript will work.