From 8d6546824d87e90d2e9bc95277e23f5a8b49dfe2 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Mon, 17 Feb 2014 17:14:54 -0500 Subject: stuff --- www/js/api.js | 6 ++++-- www/js/html5ks.js | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'www') diff --git a/www/js/api.js b/www/js/api.js index 79b735e..12e8ecc 100644 --- a/www/js/api.js +++ b/www/js/api.js @@ -58,8 +58,10 @@ window.html5ks.api = { el.onerror = function (e) { if (e.code === e.MEDIA_ERR_SRC_NOT_SUPPORTED) { - if (!_nextType()) { - console.log("no audio formats supported"); + if (_nextType()) { + console.warn("browser claimed support for " + types[i-1] + " but failed"); + } else { + console.error("no media formats supported"); } } else { console.error("unknown audio error"); diff --git a/www/js/html5ks.js b/www/js/html5ks.js index f9572b0..07d2427 100644 --- a/www/js/html5ks.js +++ b/www/js/html5ks.js @@ -1,4 +1,8 @@ "use strict"; +window.assert = function (c, m) { + if (console.assert) console.assert.apply(console, arguments); + else if (!c) throw new Error(m); +}; window.html5ks = { data: {}, persistent: {}, @@ -105,7 +109,7 @@ window.html5ks = { } }, 1000); this._spinners += mod; - console.assert(this._spinners >= 0); + assert(this._spinners >= 0); }, scale: function () { var newScale = 1; -- cgit v1.2.3-54-g00ecf