wle8300 / uifx

Audio library designed for UI sound effects
https://wle8300.github.io/uifx-demo
MIT License
112 stars 11 forks source link

Multiple uploads of the same file #26

Closed eliarhsamos closed 2 years ago

eliarhsamos commented 3 years ago

if i has

const beep = new UIfx(beepMp3);
const beep2 = new UIfx(beepMp3);

than

<audio id="uifx-1691122363" src="/_/build/4ad0857334c7e9db1ca2d6584d9de0ce.mp3" preload="auto"></audio>
<audio id="uifx-1691122363" src="/_/build/4ad0857334c7e9db1ca2d6584d9de0ce.mp3" preload="auto"></audio>
wle8300 commented 2 years ago

@eliarhsamos have you tried doing this? i think that's possible without any changes to uifx

eliarhsamos commented 2 years ago

@wle8300 After creating a duplicate, you can delete it. But it's much better and easier, just don't create it. I have attached a fix https://github.com/wle8300/uifx/pull/27/files