Skip to content

Commit

Permalink
2.15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
quinton-ashley committed Jan 18, 2025
1 parent e9f6481 commit 69ab732
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "q5",
"version": "2.15.0",
"version": "2.15.1",
"description": "A sequel to p5.js that's optimized for interactive art",
"author": "quinton-ashley",
"contributors": [
Expand Down
6 changes: 5 additions & 1 deletion q5.js
Original file line number Diff line number Diff line change
Expand Up @@ -3178,14 +3178,18 @@ Q5.modules.sound = ($, q) => {
q._preloadCount++;
let s = new Q5.Sound(path, cb);
s.crossOrigin = 'Anonymous';
s.addEventListener('canplaythrough', () => {
s.addEventListener('loadeddata', () => {
if (!s.loaded) {
q._preloadCount--;
s.loaded = true;
if (Q5.aud) s.init();
if (cb) cb(s);
}
});
s.addEventListener('error', (e) => {
q._preloadCount--;
throw e;
});
sounds.push(s);
return s;
};
Expand Down
2 changes: 1 addition & 1 deletion q5.min.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion src/q5-sound.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ Q5.modules.sound = ($, q) => {
q._preloadCount++;
let s = new Q5.Sound(path, cb);
s.crossOrigin = 'Anonymous';
s.addEventListener('canplaythrough', () => {
s.addEventListener('loadeddata', () => {
if (!s.loaded) {
q._preloadCount--;
s.loaded = true;
if (Q5.aud) s.init();
if (cb) cb(s);
}
});
s.addEventListener('error', (e) => {
q._preloadCount--;
throw e;
});
sounds.push(s);
return s;
};
Expand Down

0 comments on commit 69ab732

Please sign in to comment.