# How to add download button?

**URL:** <https://community.wowza.com/t/how-to-add-download-button/52769>\
**Category:** Wowza Streaming Engine\
**Created:** [January 31, 2019, 3:59am UTC](https://community.wowza.com/t/how-to-add-download-button/52769 "2019-01-31T03:59:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rachel\_Chen1](https://avatars.discourse-cdn.com/v4/letter/r/f05b48/32.png) [@Rachel\_Chen1](https://community.wowza.com/u/Rachel_Chen1)\
**Post date:** [January 31, 2019, 3:59am UTC](https://community.wowza.com/t/how-to-add-download-button/52769/1 "2019-01-31T03:59:03Z")

</div>

I want to add a download button to save the vod from jwplayer. Now my code likes this:

```auto
'<div id="'+ val.vid +'">' + '</div>' + '<script>' + 'var player = jwplayer(\''+ val.vid +'\');' + 'jwplayer("'+ val.vid +'").setup({playlist: [{' + 'stereomode: \''+ val.mode + '\',' + 'file: "'+ val.url +'",' + 'image: "'+ val.poster +'",' + 'height: 360,' + 'width: 640' + '}]});' + 'player.addButton(' + '"//icons.jwplayer.com/icons/white/download.svg","Download Video",' + 'function() {' + 'window.location.href = player.getPlaylistItem()[\'file\'];' + '},' + '"download");' + '</script>

```

I have created a JSON file to let jquery read the data. val.url is the video file resource. My url is :

```auto
http://172.16.218.23:1935/vod/_definst_/Videos/aim/mp4:162782R_Lenovo_Des.mp4/playlist.m3u8

```

And after I click my download button a video named playlist will be downloaded. But it cannot open.

So how should I solve this problem?

---

<div class="post-metadata">

**Author:** ![Emre\_Karatasoglu\_Adv](https://avatars.discourse-cdn.com/v4/letter/e/0ea827/32.png) [@Emre\_Karatasoglu\_Adv](https://community.wowza.com/u/Emre_Karatasoglu_Adv)\
**Post date:** [January 31, 2019, 9:20am UTC](https://community.wowza.com/t/how-to-add-download-button/52769/2 "2019-01-31T09:20:02Z")

</div>

Hi, you can’t play the m3u8 file on local pc, if you didnt downlaod all \*.ts file defined in chunk.m3u8. Even if you download m3u8 + ts, it’s not a good practice for watching video on local. You should let your client download mp4. For downloading mp4,

I suggest two way

- set up nginx with 80 port, and define the www directory to the wowza vod content folder or
- integrate this module [http://thewowza.guru/http-provider-to-serve-up-vod-assets/](http://thewowza.guru/http-provider-to-serve-up-vod-assets/)  
with this module you can easily download the vod content as mp4 file.
