diff --git a/www/clienterror.html b/www/clienterror.html index cceff21..4d62a78 100644 --- a/www/clienterror.html +++ b/www/clienterror.html @@ -26,10 +26,7 @@ - + TerranQuest @@ -41,7 +38,7 @@ - + @@ -88,8 +85,8 @@ } } }; - - + + $(document).ready(function () { $('#clientproblemmsg').text(getUrlParameter('errmsg')); }); diff --git a/www/index.html b/www/index.html index 84b39ab..4c44bbe 100644 --- a/www/index.html +++ b/www/index.html @@ -43,7 +43,7 @@ - + @@ -57,7 +57,7 @@ - + @@ -77,5 +77,4 @@ - diff --git a/www/js/music.js b/www/js/music.js index 4226ce2..83d64f2 100644 --- a/www/js/music.js +++ b/www/js/music.js @@ -18,20 +18,31 @@ var AUDIO_WAIT_SECONDS = 10; var audio_stay_stopped = false; var audio_doneplaying = true; +var audio_isplaying = false; var audio; var MUSIC_DIR = getWwwFolderPath() + "assets/audio/"; function queuesong(song) { + if (audio_isplaying) { + return; + } audio = new Media(MUSIC_DIR + song, null, null, function (status) { if ((status == Media.MEDIA_NONE || status == Media.MEDIA_STOPPED) && !audio_stay_stopped) { audio_doneplaying = true; + audio_isplaying = false; + audio.release(); setTimeout(playAudio, AUDIO_WAIT_SECONDS * 1000); } }); + audio_isplaying = true; } function playAudio() { + // If something is going on, come back in 10 seconds. + if (audio_doneplaying && audio_isplaying) { + setTimeout(playAudio, 10 * 1000); + } if (audio_doneplaying) { if (rawWeatherData.icon == "snow" || rawWeatherData.icon == "fog") { queuesong("Sisters of Snow Assent.mp3"); diff --git a/www/screens/home.html b/www/screens/home.html index 9fd8cb2..327676c 100644 --- a/www/screens/home.html +++ b/www/screens/home.html @@ -135,8 +135,8 @@ }); updateStatusBarColor(); - - setTimeout(playAudio, 10*1000); + + setTimeout(playAudio, 10 * 1000); diff --git a/www/screens/munzeelink.html b/www/screens/munzeelink.html index 86d2631..7f7abac 100644 --- a/www/screens/munzeelink.html +++ b/www/screens/munzeelink.html @@ -34,4 +34,4 @@ openscreen("home"); } }); - + \ No newline at end of file diff --git a/www/servererror.html b/www/servererror.html index af4c7bf..3f1a860 100644 --- a/www/servererror.html +++ b/www/servererror.html @@ -26,10 +26,7 @@ - + TerranQuest @@ -41,7 +38,7 @@ - + @@ -92,8 +89,8 @@ } } }; - - + + $(document).ready(function () { $('#serverproblemmsg').text(getUrlParameter('errmsg')); });