// determine highest flash version
this.CheckFlashInstall = function()
{
var PlayerVersion =[];
if(navigator.plugins && navigator.mimeTypes.length){
var x = navigator.plugins["Shockwave Flash"];
if(x && x.description) {
PlayerVersion =x.description.replace(/([a-zA-Z]|/s)+/, "").replace(/(/s+r|/s+b[0-9]+)/, ".").split(".");
}
}else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ // if Windows CE
var axo = 1;
var counter = 3;
while(axo) {
try {
counter++;
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);
PlayerVersion = [counter,0,0];
} catch (e) {
axo = null;
}
}
} else { /// Win IE (non mobile)
/// do minor version lookup in IE, but avoid fp6 crashing issues
try{
var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
}catch(e){
try {
var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
PlayerVersion =[6,0,21];
axo.AllowScriptAccess = "always";
} catch(e) {
if (PlayerVersion[0] == 6)
return PlayerVersion;
}
try {
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
} catch(e) {}
}
if (axo != null) {
PlayerVersion = axo.GetVariable("$version").split(" ")[1].split(",");
}
}
return PlayerVersion;
}
js 判断浏览器是否安装Flash
最新推荐文章于 2019-06-20 10:05:04 发布