Skip to content

Commit

Permalink
Bump version to v0.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrl committed May 21, 2018
1 parent 6ac9017 commit 10bd465
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sound-box",
"version": "0.3.2",
"version": "0.3.3",
"description": "A super simple JS library for playing sound effects and other audio. Now with button mashing support!",
"main": "soundbox.jsm",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion soundbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ class SoundBox {
}
}

SoundBox.version = "0.3.2";
SoundBox.version = "0.3.3";
3 changes: 2 additions & 1 deletion soundbox.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,11 @@ class SoundBox {
stop_all() {
// Pause all currently playing sounds
for (let instance of this.instances)
instance.dispatchEvent((new Event('ended')));
instance.pause();
this.instances = []; // Empty the instances array
}
}

SoundBox.version = "0.3.2";
SoundBox.version = "0.3.3";
export default SoundBox;
2 changes: 1 addition & 1 deletion soundbox.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 soundbox.min.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
* A super simple JS library for playing sound effects and other audio.
*/
'use strict';class SoundBox{constructor(){this.sounds={};this.instances=[];this.default_volume=1}load(a,c,d){this.sounds[a]=new Audio(c);if("function"==typeof d)this.sounds[a].addEventListener("canplaythrough",d);else return new Promise((b,e)=>{this.sounds[a].addEventListener("canplaythrough",b);this.sounds[a].addEventListener("error",e)})}remove(a){"undefined"!=typeof this.sounds&&delete this.sounds[a]}play(a,c,d=null){if("undefined"==typeof this.sounds[a])return console.error("Can't find sound called '"+
a+"'."),!1;var b=this.sounds[a].cloneNode(!0);b.volume=d||this.default_volume;b.play();this.instances.push(b);b.addEventListener("ended",()=>{let a=this.instances.indexOf(b,1);-1!=a&&this.instances.splice(a,1)});return"function"==typeof c?(b.addEventListener("ended",c),!0):new Promise((a,c)=>b.addEventListener("ended",a))}stop_all(){for(let a of this.instances)a.pause();this.instances=[]}}SoundBox.version="0.3.2";
a+"'."),!1;var b=this.sounds[a].cloneNode(!0);b.volume=d||this.default_volume;b.play();this.instances.push(b);b.addEventListener("ended",()=>{let a=this.instances.indexOf(b,1);-1!=a&&this.instances.splice(a,1)});return"function"==typeof c?(b.addEventListener("ended",c),!0):new Promise((a,c)=>b.addEventListener("ended",a))}stop_all(){for(let a of this.instances)a.dispatchEvent(new Event("ended"));instance.pause();this.instances=[]}}SoundBox.version="0.3.3";
export default SoundBox;

0 comments on commit 10bd465

Please sign in to comment.