如何将此Flash文件设为自动播放?

时间:2017-06-25 22:30:22

标签: html html5 object flash embed

查看此处加载的Flash文件:http://www.gameprehacks.com/ad.html

或查看以下代码

<object type="application/x-shockwave-flash" width="336" height="280" 
data="http://buxle.com/buxle-starsbanner.swf" >
<param name="play" value="true" />
<param name="movie" value="http://buxle.com/buxle-starsbanner.swf" />
<param name="wmode" value="direct" />
<param name="pluginspage" value="http://www.adobe.com/go/getflashplayer" />
<embed type="application/x-shockwave-flash" src="http://buxle.com/buxle-starsbanner.swf" width="336" height="280" wmode="direct" play="true" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>

它可以在Internet Explorer中使用,但在Chrome中,该文件有一个播放按钮。我需要这个在Chrome中自动播放。我怎样才能做到这一点?

非常感谢任何帮助。

谢谢

1 个答案:

答案 0 :(得分:1)

Chrome不会自动播放基于Flash的广告。很长一段时间都是这样的。
从2015年开始this article宣布Google浏览器的计划。

无论如何要避免“播放”图标:

  • 将SWF文件和HTML文件放在同一位置。
  • 或...设置较高的宽度和高度,以避免像横幅/广告一样显示。

如果您的网站也在HTTPS服务器上,请尽量使用(安全)https://链接。

使用增加的宽度/高度以及基于HTTPS的URL尝试此版本的代码。这对我有用(但你可以试试HTTP链接):

<object type="application/x-shockwave-flash" width="480" height="400" 
data="https://buxle.com/buxle-starsbanner.swf" >
<param name="play" value="true" />
<param name="movie" value="https://buxle.com/buxle-starsbanner.swf" />
<param name="wmode" value="direct" />
<param name="pluginspage" value="https://www.adobe.com/go/getflashplayer" />
<embed type="application/x-shockwave-flash" src="https://buxle.com/buxle-starsbanner.swf" width="336" height="280" wmode="direct" play="true" pluginspage="https://www.adobe.com/go/getflashplayer" />
</object>