Skip to content

Commit

Permalink
v2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
goldfire committed Jun 27, 2021
1 parent 09a3b28 commit 97cfa13
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 18 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 2.2.2 (June 27, 2021)
The README has been updated with more examples and various clarifications. PRs/issues with suggestions for further improvements are appreciated.

- `CHANGED` Include `keydown` event when unlocking audio ([#1417](https://github.com/goldfire/howler.js/pull/1417)).
- `CHANGED` The audio state is changed to `loading` while the player is buffering ([#1444](https://github.com/goldfire/howler.js/pull/1444)).
- `FIXED` Looping sounds wouldn't always work correctly in recent versions of Firefox desktop ([#1445](https://github.com/goldfire/howler.js/pull/1445)).
- `FIXED` Disabled WebM in Safari 14 until bug in Safar is resolved ([#1476](https://github.com/goldfire/howler.js/issues/1476)).
- `FIXED` Error when calling `seek()` on audio that hasn't loaded ([#1423](https://github.com/goldfire/howler.js/pull/1423)).
- `FIXED` Before a sound had loaded, calling `pause()` after `seek()` didn't have the intended behavior ([#1439](https://github.com/goldfire/howler.js/issues/1439)).

## 2.2.1 (Oct 25, 2020)
- `FIXED` The latest Safari 14 changed how WAV support was detected ([#1415](https://github.com/goldfire/howler.js/pull/1415)).
- `FIXED` Edge case that could cause an infinite loop while fading ([#1369](https://github.com/goldfire/howler.js/pull/1369)).
Expand Down
4 changes: 2 additions & 2 deletions dist/howler.core.min.js

Large diffs are not rendered by default.

36 changes: 26 additions & 10 deletions dist/howler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* howler.js v2.2.1
* howler.js v2.2.2
* howlerjs.com
*
* (c) 2013-2020, James Simpson of GoldFire Studios
Expand Down Expand Up @@ -264,8 +264,11 @@
var mpegTest = audioTest.canPlayType('audio/mpeg;').replace(/^no$/, '');

// Opera version <33 has mixed MP3 support, so we need to check for and block it.
var checkOpera = self._navigator && self._navigator.userAgent.match(/OPR\/([0-6].)/g);
var ua = self._navigator ? self._navigator.userAgent : '';
var checkOpera = ua.match(/OPR\/([0-6].)/g);
var isOldOpera = (checkOpera && parseInt(checkOpera[0].split('/')[1], 10) < 33);
var checkSafari = ua.indexOf('Safari') !== -1 && ua.indexOf('Chrome') === -1;
var isOldSafari = (checkSafari && parseInt(ua.match(/Version\/(.*?) /)[1], 10) < 15);

self._codecs = {
mp3: !!(!isOldOpera && (mpegTest || audioTest.canPlayType('audio/mp3;').replace(/^no$/, ''))),
Expand All @@ -279,8 +282,8 @@
m4a: !!(audioTest.canPlayType('audio/x-m4a;') || audioTest.canPlayType('audio/m4a;') || audioTest.canPlayType('audio/aac;')).replace(/^no$/, ''),
m4b: !!(audioTest.canPlayType('audio/x-m4b;') || audioTest.canPlayType('audio/m4b;') || audioTest.canPlayType('audio/aac;')).replace(/^no$/, ''),
mp4: !!(audioTest.canPlayType('audio/x-mp4;') || audioTest.canPlayType('audio/mp4;') || audioTest.canPlayType('audio/aac;')).replace(/^no$/, ''),
weba: !!audioTest.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, ''),
webm: !!audioTest.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, ''),
weba: !!(!isOldSafari && audioTest.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, '')),
webm: !!(!isOldSafari && audioTest.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/, '')),
dolby: !!audioTest.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/, ''),
flac: !!(audioTest.canPlayType('audio/x-flac;') || audioTest.canPlayType('audio/flac;')).replace(/^no$/, '')
};
Expand Down Expand Up @@ -392,6 +395,7 @@
document.removeEventListener('touchstart', unlock, true);
document.removeEventListener('touchend', unlock, true);
document.removeEventListener('click', unlock, true);
document.removeEventListener('keydown', unlock, true);

// Let all sounds know that audio has been unlocked.
for (var i=0; i<self._howls.length; i++) {
Expand All @@ -404,6 +408,7 @@
document.addEventListener('touchstart', unlock, true);
document.addEventListener('touchend', unlock, true);
document.addEventListener('click', unlock, true);
document.addEventListener('keydown', unlock, true);

return self;
},
Expand Down Expand Up @@ -915,6 +920,7 @@
node._unlocked = true;
if (!internal) {
self._emit('play', sound._id);
} else {
self._loadQueue();
}
})
Expand All @@ -931,7 +937,6 @@
self._playLock = false;
setParams();
self._emit('play', sound._id);
self._loadQueue();
}

// Setting rate before playing won't work in IE, so we set it again here.
Expand Down Expand Up @@ -974,8 +979,11 @@
playHtml5();
} else {
self._playLock = true;
self._state = 'loading';

var listener = function() {
self._state = 'loaded';

// Begin playback.
playHtml5();

Expand Down Expand Up @@ -1463,6 +1471,12 @@
if (loop) {
sound._node.bufferSource.loopStart = sound._start || 0;
sound._node.bufferSource.loopEnd = sound._stop;

// If playing, restart playback to ensure looping updates.
if (self.playing(ids[i])) {
self.pause(ids[i], true);
self.play(ids[i], true);
}
}
}
}
Expand Down Expand Up @@ -1582,7 +1596,9 @@
// Determine the values based on arguments.
if (args.length === 0) {
// We will simply return the current position of the first node.
id = self._sounds[0]._id;
if (self._sounds.length) {
id = self._sounds[0]._id;
}
} else if (args.length === 1) {
// First check if this is an ID, and if not, assume it is a new seek position.
var ids = self._getSoundIds();
Expand All @@ -1600,7 +1616,7 @@

// If there is no ID, bail out.
if (typeof id === 'undefined') {
return self;
return 0;
}

// If the sound hasn't loaded, add it to the load queue to seek when capable.
Expand Down Expand Up @@ -1638,12 +1654,12 @@

// Seek and emit when ready.
var seekAndEmit = function() {
self._emit('seek', id);

// Restart the playback if the sound was playing.
if (playing) {
self.play(id, true);
}

self._emit('seek', id);
};

// Wait for the play lock to be unset before emitting (HTML5 Audio).
Expand Down Expand Up @@ -2569,7 +2585,7 @@
/*!
* Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
*
* howler.js v2.2.1
* howler.js v2.2.2
* howlerjs.com
*
* (c) 2013-2020, James Simpson of GoldFire Studios
Expand Down
4 changes: 2 additions & 2 deletions dist/howler.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 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
@@ -1,6 +1,6 @@
{
"name": "howler",
"version": "2.2.1",
"version": "2.2.2",
"description": "Javascript audio library for the modern web.",
"homepage": "https://howlerjs.com",
"keywords": [
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.2.1
* howler.js v2.2.2
* howlerjs.com
*
* (c) 2013-2020, 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.2.1
* howler.js v2.2.2
* howlerjs.com
*
* (c) 2013-2020, James Simpson of GoldFire Studios
Expand Down

0 comments on commit 97cfa13

Please sign in to comment.