php - HTML\PHP : Flash Player detection technique

标签 php html flash

当我们在网站中放置 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/

相关文章:

javascript - 我如何获得提示的响应

ios - 音频和动画在使用 Flash cs6 创建的 iPad 应用程序上不同步

javascript - jQuery 无法识别 IE 中的 <embed> 元素

php - 有很多参数的函数是不是不好的形式?还有什么选择?

javascript - 每次加载页面时都会触发 PHP 邮件功能

html - 直接从链接下载图片

javascript - 使用 angularJs 包含指令和自定义标签

actionscript-3 - TouchEvent.TOUCH_BEGIN, onTouchBegin 在几次重新加载后卡住

php - Postgresql自定义函数返回表

php - tmpfile() PHP 返回 false 虽然 upload_tmp_dir 是可写的