
Make Download Button Actually Download File
Hi,
I added a download button but what I was expecting it to do was actually download the file playing to the user's device. Instead, it just refreshes the player to the source file (I guess that's how to word it?). This seems like an obvious feature, so I'm baffled as to why it seems so convoluted to make it function.
The player in question is located here directly under "Current Sermon"
http://www.livinghopesda.com/
My code:
<script src="//content.jwplatform.com/players/l9aqB9m4-7l7ZMsAW.js"></script>
<script>jwplayer("botr_l9aqB9m4_7l7ZMsAW_div").addButton(
"http://static.wixstatic.com/media/97b69b_319acd6172574c9e9c536748185f1253.png/v1/fill/w_40,h_40,al_c/97b69b_319acd6172574c9e9c536748185f1253.png","Download",
function() {
//Link to the actual file below:
window.location.href = 'http://content.jwplatform.com/videos/l9aqB9m4-EnqDUKfa.m4a';
},"download");
</script>
Thanks!
<script>
jwplayer("botr_l9aqB9m4_7l7ZMsAW_div").addButton(
//This portion is what designates the graphic used for the button
"http://static.wixstatic.com/media/97b69b_bad03957881648f79c17f33ef58c5ffa.png/v1/fill/w_40,h_40,al_c/97b69b_bad03957881648f79c17f33ef58c5ffa.png",
//This portion determines the text that appears as a tooltip
"Download",
//This portion designates the functionality of the button itself
function() {
//With the below code, we're grabbing the file that's currently playing
window.location.href = 'http://www.stephaniequinn.com/Music/Allegro%20from%20Duet%20in%20C%20Major.mp3'; //This si the file I'd like the person to download
},
//And finally, here we set the unique ID of the button itself.
"download"
);
</script>