Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Revert "hopefully fixed loading"

This reverts commit 3f50545.
  • Loading branch information...
commit 92e82c3222b7b122c64ff4654b5651917003ce05 1 parent 3f50545
Vitalij Mik authored
Showing with 10 additions and 7 deletions.
  1. +9 −6 assets/js/crafty.js
  2. +1 −1  assets/js/levels.js
15 assets/js/crafty.js
View
@@ -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"&& canplay !== "maybe") {
+ if (canplay !== "" && canplay !== "no") {
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" && canplay !== "maybe") {
+ if (canplay !== "" && canplay !== "no") {
url = source;
break;
}
@@ -7221,11 +7221,14 @@ Crafty.c("Text", {
event = 'loadstart';
canplay = obj.canPlayType(Crafty.audio.type[ext]);
-
- if(canplay !== "" && canplay !== "no" && canplay !=="maybe"){
+ if(canplay !== "" && canplay !== "no"){
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;
2  assets/js/levels.js
View
@@ -31,7 +31,7 @@ Crafty.scene("Loading",function(){
//Start scene level 1
Crafty.scene("Level1");
});
-
+
Crafty.load(toLoad,
function() {
//Everything is loaded
Please sign in to comment.
Something went wrong with that request. Please try again.