Wowza Community

How to add download button?

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

'<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(' + '"//","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 :

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?

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