flash 在firebox/IE中 提示安装 浏览器是否有flash插件
2011-11-28 17:10
369 查看
在用swfobject.js来显示flash的时候, 好像当浏览器没有flash时. 不会提示安装.
firefox / IE
1.手动方式:(在没有flash时, 会显示出一个链接提供下载安装)
2.自动方式
Firefox会显示安装插件.
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
width="760" height="193">
<param name="movie" value="Scripts/1.swf">
<param name="quality" value="high">
<embed src="Scripts/1.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" width="760" height="193" bgcolor="#D7EDAD">
</embed>
</object>
firefox / IE
1.手动方式:(在没有flash时, 会显示出一个链接提供下载安装)
<div id="divNoFlash" style=" display:none " >
<h4>
This page need Adobe Flash Player。</h4>
<p>
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
alt="Get Adobe Flash Player" width="112" height="33" /></a></p>
</div>
<h4>
This page need Adobe Flash Player。</h4>
<p>
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
alt="Get Adobe Flash Player" width="112" height="33" /></a></p>
</div>
<script>
function CheckFlashInstall() {
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;
}
var ver = CheckFlashInstall();
if (ver == "") {
document.getElementById("divNoFlash").style.display = "";
//document.write("不支持 flash");
}
else {
document.getElementById("divNoFlash").style.display = "none";
//document.write("支持 flash");
}
</script>
function CheckFlashInstall() {
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;
}
var ver = CheckFlashInstall();
if (ver == "") {
document.getElementById("divNoFlash").style.display = "";
//document.write("不支持 flash");
}
else {
document.getElementById("divNoFlash").style.display = "none";
//document.write("支持 flash");
}
</script>
2.自动方式
Firefox会显示安装插件.
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
width="760" height="193">
<param name="movie" value="Scripts/1.swf">
<param name="quality" value="high">
<embed src="Scripts/1.swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" width="760" height="193" bgcolor="#D7EDAD">
</embed>
</object>
相关文章推荐
- js判断浏览器是否安装Flash插件,并提示安装或开启
- 针对未安装 adobe flash activex 插件 的 ie 浏览器 自动提示安装
- 判断浏览器类型与是否安装了flash插件(兼容chrome,firefox,IE)
- IE和FF判断浏览器是否安装了flash插件
- JS 判断浏览器是否安装Flash 兼容IE、firefox
- 浏览器未安装flash插件,如何提示用户安装adobe flash player?
- JS 判断浏览器是否安装Flash 兼容IE、firefox
- 浏览器检测是否安装flash插件,若没有安装,则弹出安装提示
- 判断浏览器是否安装flash插件
- 判断客户端浏览器是否安装了Flash插件
- Android WebView播放视频flash(判断是否安装flash插件)
- Android WebView播放视频flash(判断是否安装flash插件)
- Android WebView播放flash(判断是否安装flash插件)
- JS判断浏览器是否安装flash插件的简单方法
- 如何用JavaScript判断客户端浏览器是否安装了Flash插件,及其版本
- Android WebView播放视频flash(判断是否安装flash插件)
- 如何用js检查浏览器是否安装flash插件
- 【原】安装adobe flash player,总是提示关闭IE的解决
- Android WebView播放视频flash(判断是否安装flash插件)