【问题标题】:Flash Embed: how do i add a message that appears instead of a flash video if a user has not installed flash?Flash Embed:如果用户没有安装 Flash,我如何添加一条消息而不是 Flash 视频?
【发布时间】:2010-07-13 19:18:51
【问题描述】:

我有一个名为abc.swf 的flash 视频,我想在用户首次注册我们的网站时播放该视频。但是,如果用户没有闪光灯,我需要它以一种简单的方式告诉他们。

出于这个原因,我试图告诉他们如何使用以下 html 下载 Flash:

<div style="text-align:center;"> 
    <p><strong>You do not have Flash installed, or it is older than the required 10.0.0.</strong></p>
    <p><strong>Click below to install the latest version and then try again.</strong></p>
    <p><a target="_blank" href="https://www.adobe.com/go/getflashplayer">
        <img src="images/get_flash_player.png" width="112" height="33" alt="Get Adobe Flash player" />
    </a></p>
</div>

困难的部分(对我来说,希望不是你^^)是让它只在他们没有安装闪存时显示。这是我到目前为止所拥有的:

    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" 
                codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
                width="720" height="488" id="xxx" align="middle">
            <param name="allowScriptAccess" value="sameDomain" />
            <param name="allowFullScreen" value="false" />
            <param name="movie" value="abc.swf" />
            <param name="quality" value="high" />
            <param name="wmode" value="gpu" />
            <param name="bgcolor" value="#ffffff" />
            <embed src="abc.swf" quality="high" wmode="gpu" bgcolor="#ffffff" 
            width="720" height="488" name="abc" 
            align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" 
            pluginspage="http://www.adobe.com/go/getflashplayer" />
            <div style="text-align:center;"> 
                <p><strong>You do not have Flash installed, or it is older than the required 10.0.0.</strong></p>
                <p><strong>Click below to install the latest version and then try again.</strong></p>
                <p><a target="_blank" href="https://www.adobe.com/go/getflashplayer">
                    <img src="images/get_flash_player.png" width="112" height="33" alt="Get Adobe Flash player" />
                </a></p>
           </div>
</object>

但无论他们是否安装了 Flash,它都会显示下载 Flash 消息,并且它会显示在视频下方(或者如果安装了 Flash,视频会在哪里)。

有没有办法做到这一点?谢谢!

【问题讨论】:

    标签: html flash embedding


    【解决方案1】:

    你可以使用SWFObject:

    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
    swfobject.embedSWF("abc.swf", "flashcontent", "720", "488", "10.0.0")
    </script>
    
    <div id="flashcontent">
    <p><strong>You do not have Flash installed, or it is older than the required 10.0.0. </strong></p>
    <p><strong>Click below to install the latest version and then try again.</strong></p>
    <p><a target="_blank" href="https://www.adobe.com/go/getflashplayer">
    <img src="images/get_flash_player.png" width="112" height="33" alt="Get Adobe Flash player" />
    </a></p>
    </div>
    

    只需下载 swfobject 并放在同一目录下即可。然后将此代码复制并粘贴到您的页面上,它应该会执行您想要的操作。

    【讨论】:

      【解决方案2】:

      您应该使用 javascript 动态创建对象,然后检查对象是否加载成功,如果没有,然后将您的消息打印到屏幕上。

      【讨论】:

        猜你喜欢
        • 2017-08-03
        • 1970-01-01
        • 1970-01-01
        • 2012-07-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多