Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Help Adding Button


Hi,

I'm trying to add a download button to out player without success. The code for the player on our page is:
<script src="//content.jwplatform.com/players/l9aqB9m4-7l7ZMsAW.js"></script>
<script>

When I tried to add the download button based off the example page it just doesn't show.
<script src="//content.jwplatform.com/players/l9aqB9m4-7l7ZMsAW.js"></script>
<script>
playerInstance.addButton(
//This portion is what designates the graphic used for the button
"https://dl.dropboxusercontent.com/u/53823971/temp_images/icon_download.png",
//This portion determines the text that appears as a tooltip
"Download Video",
//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 = playerInstance.getPlaylistItem()['file'];
},
//And finally, here we set the unique ID of the button itself.
"download"
);
</script>

I just can't figure it out. Any help is appreciated.

3 Community Answers

James Herrieven

User  
1 rated :

Try changing the following line:

playerInstance.addButton(

to be:

jwplayer("botr_l9aqB9m4_7l7ZMsAW_div").addButton(

James Herrieven
===================================================
Powered by Haiku
http://powered-by-haiku.co.uk/
---------------------------------------------------
Tatami for Online Video
http://dev.powered-by-haiku.co.uk/solutions/tatami/
---------------------------------------------------
skype: JamesHerrieven
email: james[at]haiku[dot]co[dot]uk
===================================================

Aaron

User  
0 rated :

Thank you James, that worked!

One more question if I may. The button does not function:

//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 = playerInstance.getPlaylistItem()['file'];
},
//And finally, here we set the unique ID of the button itself.
"download"

The player in question is on this page under "Most Recent Audio Sermon)
http://www.livinghopesda.com/

Aaron

User  
0 rated :

Okay, I got it to work but I was oping it would automatically download the file. Instead the player changes its appearance and I still can't actually download the mp3 to my computer.

<script src="//content.jwplatform.com/players/l9aqB9m4-7l7ZMsAW.js"></script>
<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';
},
//And finally, here we set the unique ID of the button itself.
"download"
);
</script>

This question has received the maximum number of answers.