diff --git a/src/Views.py b/src/Views.py index 637dedc..23ba5a5 100644 --- a/src/Views.py +++ b/src/Views.py @@ -94,9 +94,11 @@ def add_to_queue(entry_id): return "1" @staticmethod - @bottle.route("/play") - def play(self): - PlayerControl().play() + @bottle.route("/play/") + def play(name): + # For firefox: Use cache to answer duplicate GET requests. + bottle.response.set_header('Cache-Control', 'max-age=1') + PlayerControl().play(name) @staticmethod @bottle.route("/play_queue/") @@ -111,16 +113,22 @@ def play_playlist_entry(playlist, entry_id): @staticmethod @bottle.route("/prev") def play_previous(): + # For firefox: Use cache to answer duplicate GET requests. + bottle.response.set_header('Cache-Control', 'max-age=1') PlayerControl().previous() @staticmethod @bottle.route("/next") def play_next(): + # For firefox: Use cache to answer duplicate GET requests. + bottle.response.set_header('Cache-Control', 'max-age=1') PlayerControl().next() @staticmethod @bottle.route("/pause") def pause(): + # For firefox: Use cache to answer duplicate GET requests. + bottle.response.set_header('Cache-Control', 'max-age=1') PlayerControl().pause() @staticmethod diff --git a/src/WebPlayer.py b/src/WebPlayer.py index f3c27c8..1ba2269 100644 --- a/src/WebPlayer.py +++ b/src/WebPlayer.py @@ -110,8 +110,8 @@ def __get_source_entries(self, source): entries.append((entry_id, title)) return entries - def play(self): - self.__player.play() + def play(self, unused): + self.__player.playpause(unused) def play_entry(self, entry_id): self.__play_entry(entry_id, self.__library) @@ -204,4 +204,4 @@ def get_playlist_entries(self, playlist): return None else: return self.__get_source_entries(self.__playlists[playlist]) - \ No newline at end of file + diff --git a/web/layout.tpl b/web/layout.tpl index d53907e..44f0b26 100644 --- a/web/layout.tpl +++ b/web/layout.tpl @@ -29,7 +29,7 @@ Contributors: var updateTimer; $(document).bind("pagechange", function() { initialize(); - + var updater = new playerInfoUpdater(true); updater.update(); updateTimer = $.timer(function() { @@ -92,7 +92,7 @@ Contributors:
Previous - Play + Play Pause Stop Next diff --git a/web/script/rbplayer.js b/web/script/rbplayer.js index 5e393df..109b822 100644 --- a/web/script/rbplayer.js +++ b/web/script/rbplayer.js @@ -203,7 +203,9 @@ function playerInfoUpdater(activePage) { url: "/play_queue/" + id, type: "GET" }).success(function() { - $("#queue_popup").popup("close"); + $("#queue_popup").popup("close"); + // Reload page to force restart of updateTimer (Nokia browser). + location.reload(); }); }); $queue_list.append($link);