/
jquery.flickrVideo-1.0.min.js
11 lines (9 loc) · 1.38 KB
/
jquery.flickrVideo-1.0.min.js
1
2
3
4
5
6
7
8
9
10
11
/**
* Flickr Video Plugin
* @author Darcy Clarke
*
* Copyright (c) 2012 Darcy Clarke
* Dual licensed under the MIT and GPL licenses.
* http://darcyclarke.me/
*/
(function(a){a.fn.flickrVideo=function(b){var c=a.extend({url:"",height:400,width:600,bgcolor:"#000000",key:"",secret:""},b),d,e="flickr.photos.getInfo",f="json",g=this,h=false;d=c.url.match(/\/photos\/(.*)/)[1].split("/")[1];a.ajax({url:"http://www.flickr.com/services/rest/?method="+e+"&format="+f+"&api_key="+c.key,dataType:"jsonp",data:{photo_id:d},type:"GET",jsonpCallback:"jsonFlickrApi",success:function(b){if(b.photo.media==="video"){g.each(function(){a(this).append('<object type="application/x-shockwave-flash" width="'+c.width+'" height="'+c.height+'" data="http://www.flickr.com/apps/video/stewart.swf?v=49235" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><param name="flashvars" value="intl_lang=en-us&photo_secret='+b.photo.secret+"&photo_id="+d+'"><param name="movie" value="http://www.flickr.com/apps/video/stewart.swf?v=49235"><param name="bgcolor" value="'+c.bgcolor+'"><param name="allowFullScreen" value="true"><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/video/stewart.swf?v=49235" bgcolor="'+c.bgcolor+'" allowfullscreen="true" flashvars="intl_lang=en-us&photo_secret='+b.photo.secret+"&photo_id="+d+'" height="'+c.height+'" width="'+c.width+'"></object>')})}}});return g}})(jQuery);