malsup / media

jQuery Media Plugin
http://jquery.malsup.com/media/
308 stars 446 forks source link

Support url without file extension like pdf on href or src #26

Closed vincentruan closed 6 years ago

vincentruan commented 6 years ago

Hi, When I get a pdf attachment from url 'getxxxpdf', the render of this plugin does not work, but if I change the url to 'xxx.pdf', it works.

Could it get the http file type from response header 'Content-Type'? Or provide a parameter to override the default setting?

vincentruan commented 6 years ago

I found the solution in source code,

in line 74, if (o.type) m[0] = o.type;

So we can set parameter "type" to point out the flash plugin.

like this. $('a.media').media({width: 800, height: 600, type: 'pdf'});