当我们在我们的网站上放置flash文件时,OFF-COURSE需要客户机上的flash播放器,并提示安装flash播放器......
是否有一些PHP代码使用它我可以检查天气有客户端机器上的Flash播放器,如果没有那么而不是放置\嵌入一个Flash文件我在那里放置图像...
在我的具体情况下,闪光灯并不是那么重要......它只适用于化妆品,动画......我可以用gif或简单的jpeg取代并不重要......
但我能做到吗
答案 0 :(得分:3)
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>
答案 1 :(得分:1)
请参阅此文章 - http://www.adobe.com/devnet/flash/articles/fp8_detection.html
Adobe已经对此进行了排序,因此您可以提供替代内容/直接用户安装Flash /检测哪个版本的Flash用户,然后根据需要从您的网站安装最新版本,而无需访问adobe网站。
实现这一点的一些工作取决于用户使用闪存的重要性,或者替代内容是否也能正常工作。但是为了提供Flash内容并确保用户安装了正确的版本,Flash Detection Kit运行良好。
答案 2 :(得分:0)
怎么样
<?
// Search through the HTTP_ACCEPT header for the Flash Player MIME type.
if (strstr($_SERVER['HTTP_ACCEPT'], 'application/x-shockwave-flash'))
{
$hasFlash = true;
}
if ($hasFlash)
{
// EMBED
} else {
// IMG
};
?>