Skip to content
Browse files

hopefully fixed loading

  • Loading branch information...
1 parent fb94ef0 commit 3f5054526e402d885964ed14d6e602d9cda95245 @BlackScorp committed
Showing with 7 additions and 10 deletions.
  1. +6 −9 assets/js/crafty.js
  2. +1 −1 assets/js/levels.js
View
15 assets/js/crafty.js
@@ -6163,9 +6163,9 @@ Crafty.c("particles", {
//get the file extension
ext = source.substr(source.lastIndexOf('.') + 1).toLowerCase();
canplay = audio.canPlayType(this.type[ext]);
-
+
//if browser can play this type, use it
- if (canplay !== "" && canplay !== "no") {
+ if (canplay !== "" && canplay !== "no"&& canplay !== "maybe") {
url = source;
break;
}
@@ -6199,7 +6199,7 @@ Crafty.c("particles", {
canplay = audio.canPlayType(this.type[ext]);
//if browser can play this type, use it
- if (canplay !== "" && canplay !== "no") {
+ if (canplay !== "" && canplay !== "no" && canplay !== "maybe") {
url = source;
break;
}
@@ -7221,14 +7221,11 @@ Crafty.c("Text", {
event = 'loadstart';
canplay = obj.canPlayType(Crafty.audio.type[ext]);
- if(canplay !== "" && canplay !== "no"){
+
+ if(canplay !== "" && canplay !== "no" && canplay !=="maybe"){
this.assets[current] = obj;
- }else{
- j--;
- delete obj;
}
- //Chrome doesn't trigger onload on audio, see http://code.google.com/p/chromium/issues/detail?id=77794
- if (navigator.userAgent.indexOf('Chrome') != -1) j++;
+
} else if (ext === "jpg" || ext === "jpeg" || ext === "gif" || ext === "png") {
obj = new Image();
obj.src = current;
View
2 assets/js/levels.js
@@ -31,7 +31,7 @@ Crafty.scene("Loading",function(){
//Start scene level 1
Crafty.scene("Level1");
});
-
+
Crafty.load(toLoad,
function() {
//Everything is loaded

0 comments on commit 3f50545

Please sign in to comment.
Something went wrong with that request. Please try again.