diff options
-rw-r--r-- | www/js/api.js | 8 | ||||
-rw-r--r-- | www/js/html5ks.js | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/www/js/api.js b/www/js/api.js index 833b120..d659cbb 100644 --- a/www/js/api.js +++ b/www/js/api.js @@ -78,13 +78,13 @@ window.html5ks.api = new (function () { audio.onerror = function (e) { if (e.code === e.MEDIA_ERR_SRC_NOT_SUPPORTED) { i = setNextType(i); - if (i) { + if (!i) { + console.log("no audio formats supported"); deferred.resolve(); - } else { - throw new Error(e); } } else { - throw new Error(e); + console.error("unknown audio error"); + deferred.resolve(); } }; audio.load(); diff --git a/www/js/html5ks.js b/www/js/html5ks.js index e1c0bd7..093505e 100644 --- a/www/js/html5ks.js +++ b/www/js/html5ks.js @@ -19,7 +19,11 @@ window.html5ks = { sfxVolume: 1, language: "en" }; - var loaded = localStorage.persistent ? JSON.parse(localStorage.persistent) : {}; + try { + var loaded = localStorage.persistent ? JSON.parse(localStorage.persistent) : {}; + } catch (e) { + var loaded = {}; + } var defProp = function (v) { Object.defineProperty(html5ks.persistent, k, { get: function () { |