From a17e2dfe7a2ed9b033ce8ee224395fdaea21bdfe Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Tue, 21 Jan 2014 13:37:18 -0500 Subject: Stuff. --- www/js/api.js | 8 ++++---- 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 () { -- cgit v1.2.3-70-g09d2