当我们在网站中放置 Flash 文件时,它会离线要求客户端计算机上安装 Flash 播放器,并提示安装 Flash 播放器...
是否有一些 php 代码可以用来检查客户端计算机上是否有 Flash 播放器,如果没有,则不是放置/嵌入 Flash 文件,而是在其中放置图像...
因为在我的具体情况下,flash 并不是那么重要...它只是用于化妆品、动画...我可以用 gif 或简单的 jpeg 替换它并不重要...
但是我可以做到吗
最佳答案
swfobject可以帮忙解决这个问题。
您可以将Flash无法显示时要显示的内容放在代码中应该是Flash对象的位置,并将脚本指向它。
在代码中:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>TestFlash</title>
<!--import the swfobject library /-->
<script type="text/javascript" src="swfobject.js"></script>
<!--Define which div (by ID) gets replaced if flash is present /-->
<script type="text/javascript">
swfobject.embedSWF("myContent.swf", "flash1", "300", "120", "9.0.0");
</script>
</head>
<body>
<h1>We are testing some flash</h1>
<hr />
<div id="flash1">
<!-- This stuff will show if flash is not present on the machine /-->
<img src="/img/image1.jpg" />
</div>
<hr />
<h2>this is a footer</h2>
</body>
</html>
关于php - HTML\PHP : Flash Player detection technique,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3805138/