git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 28196ce7 authored by mattl's avatar mattl

Download button

parent 1c74498b
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
*/ */
var audio; var audio;
var dlbutton;
var scrobbled, now_playing, tracktoptags; var scrobbled, now_playing, tracktoptags;
var artist, album, track, trackpage, radio_key, ws_key, api_key, station; var artist, album, track, trackpage, radio_key, ws_key, api_key, station;
var playlist = [], current_song = 0; var playlist = [], current_song = 0;
...@@ -44,6 +45,7 @@ var base_url = base_url || ""; ...@@ -44,6 +45,7 @@ var base_url = base_url || "";
*/ */
function playerInit(list, ws, rk, stationurl, gnufm_key) { function playerInit(list, ws, rk, stationurl, gnufm_key) {
audio = document.getElementById("audio"); audio = document.getElementById("audio");
dlbutton = document.getElementById("dlbutton");
if (!list) { if (!list) {
// We're playing a stream instead of a playlist // We're playing a stream instead of a playlist
streaming = true; streaming = true;
...@@ -452,6 +454,7 @@ function loadSong(song) { ...@@ -452,6 +454,7 @@ function loadSong(song) {
scrobbled = false; scrobbled = false;
now_playing = false; now_playing = false;
audio.src = url; audio.src = url;
dlbutton.href = url;
audio.load(); audio.load();
if(streaming && current_song > playlist.length - 3) { if(streaming && current_song > playlist.length - 3) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment