Skip to content

Commit

Permalink
fix a regression that broke simple audio play/pause usage
Browse files Browse the repository at this point in the history
  • Loading branch information
obiot committed Dec 20, 2018
1 parent b72a036 commit 70d7084
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Version History
---------------
6.3.0
* Audio : audio core update (2.1.0) that mostly improve auto audio unlock on latest (non-mobile) browser versions
* Audio : fix a regression that broke simple play/pause usage
* Color : fix alpha value not being properly clamped (leading to issue in WebGL mode when passing the glArray buffer)
* Debug : fix wrong bounding box drawing position for nested containers
* Renderable : added support for rendering mask (in both Canvas and WebGL mode), allowing to use any me.Shape object as a mask
Expand Down
18 changes: 18 additions & 0 deletions src/vendors/howler.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,24 @@
} else if (typeof sprite === 'undefined') {
// Use the default sound sprite (plays the full audio length).
sprite = '__default';

// Check if there is a single paused sound that isn't ended.
// If there is, play that sound. If not, continue as usual.
if (!self._playLock) {
var num = 0;
for (var i=0; i<self._sounds.length; i++) {
if (self._sounds[i]._paused && !self._sounds[i]._ended) {
num++;
id = self._sounds[i]._id;
}
}

if (num === 1) {
sprite = null;
} else {
id = null;
}
}
}

// Get the selected node, or get one from the pool.
Expand Down

0 comments on commit 70d7084

Please sign in to comment.