Skip to content

Commit

Permalink
v2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
goldfire committed Mar 11, 2017
1 parent f5f5edc commit 4ebd189
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 33 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 2.0.3 (March 11, 2017)
- `CHANGED` Unloading a sound no longer fires the `end` event ([#675](https://github.com/goldfire/howler.js/pull/675)).
- `FIXED` Remove `setTimeout` wrapper on HTML5 `play` call to fix issues on mobile browsers ([#694](https://github.com/goldfire/howler.js/pull/694)).
- `FIXED` Remove rare possibility of duplicate sound ID's by using global counter ([#709](https://github.com/goldfire/howler.js/issues/709)).
- `FIXED` Support fades with 2+ decmial places ([#696](https://github.com/goldfire/howler.js/issues/696)).
- `FIXED` Error in Firefox caused by invalid silent WAV on `unload` ([#678](https://github.com/goldfire/howler.js/issues/678)).
- `FIXED` Check for and warn about missing file extension ([#680](https://github.com/goldfire/howler.js/issues/680)).
- `FIXED` Regression in Firefox relating to spatial audio ([#664](https://github.com/goldfire/howler.js/issues/664)).

## 2.0.2 (December 4, 2016)
- `FIXED` Wait to begin playback until AudioContext has resumed ([#643](https://github.com/goldfire/howler.js/issues/643)).
- `FIXED` Run `noAudio` check on initial setup instead of waiting for first `Howl` ([#619](https://github.com/goldfire/howler.js/issues/619)).
Expand Down
4 changes: 2 additions & 2 deletions dist/howler.core.min.js

Large diffs are not rendered by default.

51 changes: 28 additions & 23 deletions dist/howler.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*!
* howler.js v2.0.2
* howler.js v2.0.3
* howlerjs.com
*
* (c) 2013-2016, James Simpson of GoldFire Studios
* (c) 2013-2017, James Simpson of GoldFire Studios
* goldfirestudios.com
*
* MIT License
Expand Down Expand Up @@ -30,6 +30,9 @@
init: function() {
var self = this || Howler;

// Create a global ID counter.
self._counter = 0;

// Internal properties.
self._codecs = {};
self._howls = [];
Expand Down Expand Up @@ -559,8 +562,13 @@
}
}

// Log a warning if no extension was found.
if (!ext) {
console.warn('No file extension was found. Consider using the "format" property or specify an extension.');
}

// Check if this extension is available.
if (Howler.codecs(ext)) {
if (ext && Howler.codecs(ext)) {
url = self._src[i];
break;
}
Expand Down Expand Up @@ -723,7 +731,8 @@
playWebAudio();
} else {
// Wait for the audio to load and then begin playback.
self.once(isRunning ? 'load' : 'resume', playWebAudio, isRunning ? sound._id : null);
var event = !isRunning && self._state === 'loaded' ? 'resume' : 'load';
self.once(event, playWebAudio, isRunning ? sound._id : null);

// Cancel the end timer.
self._clearTimer(sound._id);
Expand All @@ -735,19 +744,16 @@
node.muted = sound._muted || self._muted || Howler._muted || node.muted;
node.volume = sound._volume * Howler.volume();
node.playbackRate = sound._rate;
node.play();

setTimeout(function() {
node.play();

// Setup the new end timer.
if (timeout !== Infinity) {
self._endTimers[sound._id] = setTimeout(self._ended.bind(self, sound), timeout);
}
// Setup the new end timer.
if (timeout !== Infinity) {
self._endTimers[sound._id] = setTimeout(self._ended.bind(self, sound), timeout);
}

if (!internal) {
self._emit('play', sound._id);
}
}, 0);
if (!internal) {
self._emit('play', sound._id);
}
};

// Play immediately if ready, or wait for the 'canplaythrough'e vent.
Expand Down Expand Up @@ -1135,10 +1141,10 @@
}

// When the fade is complete, stop it and fire event.
if (vol === to) {
if ((to < from && vol <= to) || (to > from && vol >= to)) {
clearInterval(sound._interval);
sound._interval = null;
self.volume(vol, soundId);
self.volume(to, soundId);
self._emit('fade', soundId);
}
}.bind(self, ids[i], sound), stepLen);
Expand Down Expand Up @@ -1468,13 +1474,12 @@
// Stop the sound if it is currently playing.
if (!sounds[i]._paused) {
self.stop(sounds[i]._id);
self._emit('end', sounds[i]._id);
}

// Remove the source or disconnect.
if (!self._webAudio) {
// Set the source to 0-second silence to stop any downloading.
sounds[i]._node.src = 'data:audio/wav;base64,UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA=';
sounds[i]._node.src = 'data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA';

// Remove any event listeners.
sounds[i]._node.removeEventListener('error', sounds[i]._errorFn, false);
Expand Down Expand Up @@ -1890,7 +1895,7 @@
self._sprite = '__default';

// Generate a unique ID for this sound.
self._id = Math.round(Date.now() * Math.random());
self._id = ++Howler._counter;

// Add itself to the parent's pool.
parent._sounds.push(self);
Expand Down Expand Up @@ -1960,7 +1965,7 @@
self._sprite = '__default';

// Generate a new ID so that it isn't confused with the previous sound.
self._id = Math.round(Date.now() * Math.random());
self._id = ++Howler._counter;

return self;
},
Expand Down Expand Up @@ -2192,10 +2197,10 @@
/*!
* Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
*
* howler.js v2.0.2
* howler.js v2.0.3
* howlerjs.com
*
* (c) 2013-2016, James Simpson of GoldFire Studios
* (c) 2013-2017, James Simpson of GoldFire Studios
* goldfirestudios.com
*
* MIT License
Expand Down
6 changes: 3 additions & 3 deletions dist/howler.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/howler.spatial.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"uglify-js": "2.x"
},
"main": "dist/howler.js",
"version": "2.0.2",
"version": "2.0.3",
"license": {
"type": "MIT",
"url": "https://raw.githubusercontent.com/goldfire/howler.js/master/LICENSE.md"
Expand Down
2 changes: 1 addition & 1 deletion src/howler.core.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* howler.js v2.0.2
* howler.js v2.0.3
* howlerjs.com
*
* (c) 2013-2017, James Simpson of GoldFire Studios
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/howler.spatial.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
* Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
*
* howler.js v2.0.2
* howler.js v2.0.3
* howlerjs.com
*
* (c) 2013-2017, James Simpson of GoldFire Studios
Expand Down

0 comments on commit 4ebd189

Please sign in to comment.