Skip to content

Commit

Permalink
add a Howler.js
Browse files Browse the repository at this point in the history
  • Loading branch information
nakasyou committed Dec 30, 2022
1 parent 4e2dcfa commit c0765b4
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 12 deletions.
12 changes: 11 additions & 1 deletion CREDIT
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,14 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.


===howler.js=== https://github.com/goldfire/howler.js/
Copyright (c) 2013-2020 James Simpson and GoldFire Studios, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
44 changes: 39 additions & 5 deletions dist/kagura.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/kagura.min.js

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions src/api/howler.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class{
constructor(url){
this.url=url;
}
make(options){
options.src=[this.url];
return new kagura.Howl(options);
}
}
8 changes: 8 additions & 0 deletions src/api/isurl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
function(str){
try {
new URL(str);
return true;
}catch (e){
return false;
}
}
9 changes: 9 additions & 0 deletions src/api/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ class{
if(!loads){
console.error("Loads arguments is undefined.");return;
}
const invurls={};
Object.keys(loads).forEach(key=>{
const url=loads[key];
if(kagura.api.isUrl(key)){
invurls[key]=url;
}
});
loads=invurls;
this.assets={};
if(!loaded)loaded=function(){};
this.loaded=loaded;
Expand Down Expand Up @@ -39,6 +47,7 @@ class{
my._text=new FileReader()
my._text.readAsText(my.blobObj)
my.sounder=new kagura.Sounder(my.blob);
my.howler=new kagura.api.Houler(my.blob);
}
setTimeout(()=>this.loadedOneXhr(load),0)
};
Expand Down
5 changes: 4 additions & 1 deletion src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ const kagura=function(){
pixi:PIXI,
api:{}
};
kagura.exitFullscreen=Document.exitFullscreen;
kagura.Howl=Howl;
kagura.api.Howler={{!api/howler.js!}};
kagura.api.isUrl={{!api/isurl.js!}};
kagura.exitFullscreen=document.exitFullscreen;
kagura.Grid={{!api/grid.js!}}
kagura.browser={{!browsercheck.js!}}(window.navigator.userAgent)
kagura.Timer={{!api/timer.js!}}
Expand Down
4 changes: 4 additions & 0 deletions src/lib/howler.min.js

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{{!lib/scaleToWindow.js!}}
{{!pixi/pixi.min.js!}}
{{!pixi/graphics-extras.min.js!}}
{{!core.js!}}
const kagura=((function(){
{{!lib/howler.min.js!}}
{{!lib/scaleToWindow.js!}}
{{!pixi/pixi.min.js!}}
{{!pixi/graphics-extras.min.js!}}
{{!core.js!}}
return kagura;
})()||kagura)

0 comments on commit c0765b4

Please sign in to comment.