Example: Adding a Download Button

This page has moved to our new developer site!  Please visit the updated location here.

Thanks for your patience while we update our documentation.

You will be automatically redirected in 10 seconds.



This example will show you how to allow users to easily download a video file. This button will be added with our addButton API call.


This example uses the addButton() API call to append an additional item to the player. The code to do so (With comments!) is as follows:

//This portion is what designates the graphic used for the button
//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.

Note that this API call will draw in whichever playlist item is currently loaded. This may cause issues if you're using an M3U8 or manifest file, but it is possible to set a static video file such as an MP4 instead.

Did you find this article helpful?

Please log in to rate this article.