2010-09-27 98 views
2

,当我们把我们的网站上的Flash文件,它场外需要在客户机上的Flash Player,并提示安装Flash Player ...HTML PHP:Flash Player检测技术

有没有使用一些PHP代码我可以检查天气有客户端机器上的Flash播放器,如果不是那么放置\嵌入一个Flash文件我放置在那里的图像...

因为在我的具体情况闪光灯并不那么重要。 ..它只是为化妆品,动画...我可以用gif或简单的jpeg替换无关紧要的...

但我可以吗?

+0

如何更新我的答案有一个代码示例... – Powertieke 2010-09-27 19:25:25

回答

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> 
+0

这个怎么样http://stackoverflow.com/questions/3805138/html-php-flash-player-detection-technique/ 3805936#3805936 – Moon 2010-09-27 16:45:50

1

看到这篇文章 - http://www.adobe.com/devnet/flash/articles/fp8_detection.html

的Adobe已经得到现在这个排序,所以你可以提出替代内容/直接用户安装Flash /检测的Flash用户的版本有然后根据需要从您的网站安装最新版本,而无需访问Adobe网站。

有一点工作要做到这一点,取决于用户使用闪光灯的重要性,以及替代内容的效果。但为了传送闪光灯内容并确保用户将安装正确的版本,闪光检测套件非常适用。

+0

...我重新读你的问题,虽然我的建议是检测闪存版本很好,可能是你的情况矫枉过正。按照powertieke的建议,我会考虑使用swfobject - 我将这个答案投给了答案。 – undefined 2010-09-27 15:24:05

+0

怎么样这个http://stackoverflow.com/questions/3805138/html-php-flash-player-detection-technique/3805936#3805936 – Moon 2010-09-27 16:45:02

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 
}; 

?> 
+0

这将工作如何?何处以及如何定义'$ hasFlash'? – Powertieke 2010-09-27 19:06:17

+0

不适用于所有浏览器我已被告知 – Powertieke 2010-09-27 19:28:28

+0

根据我的谷歌搜索不适用于Safari Mac – Moon 2010-09-27 19:42:51