javascript 如何使用 SWFObject 检测 Flash

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5717062/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 18:06:47  来源:igfitidea点击:

how to detect flash using SWFObject

javascriptflashswfobject

提问by Mazatec

I have downloaded SWFObject, and included it in my website. Now I want to simply get a trueor falsevalue based on whether or not Flash is installed in the users browser when they visit my site.

我已经下载了SWFObject,并将其包含在我的网站中。现在我想根据用户访问我的网站时是否在浏览器中安装 Flash来简单地获取一个truefalse值。

How can I do this?

我怎样才能做到这一点?

回答by andynormancx

if (swfobject.hasFlashPlayerVersion("9.0.18")) {
  // has Flash
}
else {
  // no Flash
}

or replace "9.0.18"with the minimum version you require

或替换"9.0.18"为您需要的最低版本

回答by cachaito

If You use jQuery SWFObject you could use:

如果您使用 jQuery SWFObject,您可以使用:

if (!$.flash.hasVersion('9')) {
 //has Flash
}
else {
 //no_flash
}