0
我嵌入瑞士法郎文件swfobject。我不想让swf文件(这是一个广告)自动播放,所以我将播放的属性设置为“false”。如下html:瑞士法郎(闪光灯)在铬自动播放
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="swfobject/swfobject.js"></script>
<script type="text/javascript">
swfobject.registerObject("myFlashContent", "9.0.0", "expressInstall.swf");
</script>
</head>
<body>
<div>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="970" height="250" id="myFlashContent">
<param name="movie" value="day_110702/ad.swf" />
<param name="play" value="false" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="day_110702/ad.swf" width="970" height="250">
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>
它在IE上运行完美,但它不适用于Chrome/Firefox。在Chrome/Firefox中,swf文件会自动播放。
此外,swf文件的另一行为与Chrome/Firefox不同,IE为: 当您嵌入带有隐形iframe标记的swf文件时。作为
<iframe id="iframe" src="swf.html" style="width:100%;height:100%; display:none; visibility:hidden;"></iframe>
当您浏览包含此iframe在IE/Firefox的网页时,SWF不会玩,直到你做的iframe可见。但是,如果您在Chrome中浏览页面,即使iframe不可见,swf也会自动播放。
任何人都可以告诉我为什么不同浏览器中的swf(flash)行为有所不同? 跨浏览器问题总是让人发疯:)。
谢谢PaulT,但这不是我想知道的答案。我想知道的是为什么Flash行为在浏览器之间有所不同。 –