jplayer / jPlayer

jPlayer : HTML5 Audio & Video for jQuery
http://jplayer.org/
Other
4.6k stars 1.47k forks source link

Download free item ? #404

Open B-Poignant opened 6 years ago

B-Poignant commented 6 years ago

Hi,

I see something strange on free item, when you click on free item link, it s just play this item but dont download it.

Example : http://jplayer.org/latest/demo-02-video/ When i click on m4v link it s read the first video, it's a bug ?

HTML :
<a class="jp-playlist-item-free" href="http://www.jplayer.org/video/webm/Big_Buck_Bunny_Trailer.webm" tabindex="-1">webmv</a>
JS :
 a(this.cssSelector.playlist).off("click", "a." + this.options.playlistOptions.freeItemClass).on("click", "a." + this.options.playlistOptions.freeItemClass, function(c) {
                                c.preventDefault(),
                                a(this).parent().parent().find("." + b.options.playlistOptions.itemClass).click(),
                                b.blur(this)
                        }),

Why "c.preventDefault()" and why no download attribute on a ? See download attribute : https://www.w3schools.com/tags/att_a_download.asp

MartinDawson commented 6 years ago

Probably because download attribute wasn't widely supported (if at all) when this was created. https://caniuse.com/#search=download%20att