diff options
author | sanine <sanine.not@pm.me> | 2024-07-06 23:27:32 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2024-07-06 23:27:32 -0500 |
commit | bf199ccd7b45a77f021d3b414a5c380bd4c790e4 (patch) | |
tree | 201ab4cb40673fa401a5cdf24142460a602c423e | |
parent | fae278000ff919aed473625f704c0a2a62bdf443 (diff) |
preload sfx
-rw-r--r-- | index.html | 12 | ||||
-rw-r--r-- | main.js | 2 |
2 files changed, 7 insertions, 7 deletions
@@ -18,13 +18,13 @@ <audio id="music-cribwhistling" src="sounds/music/cribwhistling.mp3"></audio> <audio id="music-swish" src="sounds/music/swish.mp3"></audio> <audio id="music-aeroplane" src="sounds/music/aeroplane.mp3"></audio> - <audio id="sfx-resource" src="sounds/sfx/gui-beep/33776__jobro__1-beep-b.wav"></audio> - <audio id="sfx-done" src="sounds/sfx/gui-beep/33787__jobro__5-beep-a.wav"></audio> - <audio id="sfx-wrong" src="sounds/sfx/gui-beep/33789__jobro__5-beep-c.wav"></audio> - <audio id="sfx-buttonenter" src="sounds/sfx/gui-beep/33777__jobro__1-beep-c.wav"></audio> - <audio id="sfx-buttonclick" src="sounds/sfx/gui-beep/33780__jobro__2-beep-c.wav"></audio> - <audio id="sfx-listappear" src="sounds/sfx/gui-beep/33775__jobro__1-beep-a.wav"></audio> + <audio preload="auto" id="sfx-resource" src="sounds/sfx/gui-beep/33776__jobro__1-beep-b.wav"></audio> + <audio preload="auto" id="sfx-done" src="sounds/sfx/gui-beep/33787__jobro__5-beep-a.wav"></audio> + <audio preload="auto" id="sfx-wrong" src="sounds/sfx/gui-beep/33789__jobro__5-beep-c.wav"></audio> + <audio preload="auto" id="sfx-buttonenter" src="sounds/sfx/gui-beep/33777__jobro__1-beep-c.wav"></audio> + <audio preload="auto" id="sfx-buttonclick" src="sounds/sfx/gui-beep/33780__jobro__2-beep-c.wav"></audio> + <audio preload="auto" id="sfx-listappear" src="sounds/sfx/gui-beep/33775__jobro__1-beep-a.wav"></audio> <div id="root"></div> <div id="overlay"></div> @@ -76,7 +76,7 @@ window.onload = () => setTimeout(() => { Promise.all([...Object.values(sfx)].map(x => new Promise(resolve => { x.load(); - x.addEventListener('canplaythrough', resolve); + x.addEventListener('canplaythrough', resolve, false); }))).then( () => setupLevelSelectUi(root, sfx) ); |