前に作ったjQueryプラグインswfdetect.jsを再度
zipがwebサーバで弾かれているようなので、ソースコードをそのまま公開します。
特に意味はありません。
/** * jQuery detection plugin. * * Copyright (c) 2009 at.kibe * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * * The information bar is displayed by the result of the judgment * of the version of Flash. * * @author at.kibe * @version 0.1.1 */ (function ($) { $.detect = { object : { classid : "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", codebase : "http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab", width : "0", height : "0" }, embed : { style : "display:none;", width : "0", height : "0", type : "application/x-shockwave-flash", pluginspage : "http://www.macromedia.com/go/getflashplayer" }, call : function (id, ver) { if (ver != null) $.detect.object.codebase += "#version=" + ver.replace(".", ","); $("#" + id).append($.detect.element("object", false, $.detect.object)) .append($.detect.element("embed", false, $.detect.embed)) .append("</embed></object>"); }, element : function (name, close, atr) { var key, html = []; html.push("<" + name + " "); for (key in atr) html.push(key + "=\"" + atr[key] + "\" "); html.push(close == true ? "/>" : ">"); return html.join(""); } }; swfDetect = function (file, id, ver) { if (/chrome/i.test(navigator.userAgent)) { var swf = $("object").attr("data"); if (swf && file != (swf = swf.split("/"))[swf.length - 1]) return; } $.detect.call(id, ver); }; })(jQuery);
面倒だと思いますが、プラグイン本体以外のファイルは下記をご確認ください。
- サンプルhtml --index.html
< http://atkibe.web.fc2.com/swfdetect/0_1_1/index.html >
- GPL-LICENSEファイル
< http://atkibe.web.fc2.com/swfdetect/0_1_1/GPL-LICENSE.txt >
- MIT-LICENSEファイル
< http://atkibe.web.fc2.com/swfdetect/0_1_1/MIT-LICENSE.txt >
-
- プラグイン --swfdetect.js
< http://atkibe.web.fc2.com/swfdetect/0_1_1/js/swfdetect.js >
-
- swfobject --swfobject.js
< http://atkibe.web.fc2.com/swfdetect/0_1_1/js/swfobject.js >
< http://atkibe.web.fc2.com/swfdetect/0_1_1/js/jquery.js >
-
- サンプルswf --player.swf
< http://atkibe.web.fc2.com/swfdetect/0_1_1/swf/player.swf >
※ swfファイルは右クリックで対象をファイルに保存でダウンロードしてください。