Html 嵌入式 Flash 在 Google Chrome 中不起作用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4847111/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Embedded Flash not working in Google Chrome?
提问by allencoded
So I have a flash site and I am curious why it is not working in Chrome. The site works great for Safari, Firefox, and IE. Just won't work in Chrome. Well below is the code and any help is necessary. Also can you explain why it doesn't work?
所以我有一个 Flash 站点,我很好奇为什么它在 Chrome 中不起作用。该网站非常适合 Safari、Firefox 和 IE。只是不能在 Chrome 中工作。下面是代码,需要任何帮助。你也能解释为什么它不起作用?
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="750" height="470" id="mariocoded" align="middle">
<param name="movie" value="mariocoded.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="mariocoded.swf" width="750" height="470">
<param name="movie" value="mariocoded.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflash">
<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>
回答by weltraumpirat
You have two nested <object>
tags instead of <object>
and <embed>
. Chrome, Safari and FF all use <embed>
, so it's actually surprising the player runs in FF and Safari at all.
您有两个嵌套<object>
标签而不是<object>
and <embed>
。 Chrome、Safari 和 FF 都使用<embed>
,因此播放器在 FF 和 Safari 中运行实际上令人惊讶。
回答by run-time
replace all that code with just this single line of code and it should work in all browsers...
用这一行代码替换所有代码,它应该适用于所有浏览器......
<embed src="mariocoded.swf" width="750" height="470" />
回答by triemstr
I had a similar problem...if I took away the param name="movie" from the outer object it worked for me (but of course not in IE so you have to selectively show it for IE). I think chrome gets confused and recognizes the movie parameter but instead of ignoring it, it decides that it just won't show anything.
我有一个类似的问题......如果我从它为我工作的外部对象中拿走了参数名称 =“电影”(但当然不是在 IE 中,所以你必须有选择地为 IE 显示它)。我认为 chrome 会感到困惑并识别电影参数,但它并没有忽略它,而是决定它不会显示任何内容。
Another interesting thing is that if you open up the developer tools for google chrome (using your original code) you can mouseover the html flashContent div and the flash file will appear. It's like it's there underneath but the movie parameter screws it up.
另一个有趣的事情是,如果您打开 google chrome 的开发人员工具(使用您的原始代码),您可以将鼠标悬停在 html flashContent div 上,flash 文件就会出现。就像它在下面,但电影参数把它搞砸了。
Hope this helps.
希望这可以帮助。
Kevin
凯文
回答by Simon
Kevin you got it - If you inspect the flash element using Chrome's element inspector, edit as html and remove the name=movie it will display so the conditional comments should work wonders
凯文你明白了 - 如果你使用 Chrome 的元素检查器检查 flash 元素,编辑为 html 并删除它会显示的 name=movie,这样条件注释应该会产生奇迹
回答by Mrug
You may try like this, as i am also using Flash in Chrome but for that i have used Both as here
你可以这样尝试,因为我也在 Chrome 中使用 Flash,但为此我在这里使用了两者
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="1000" height="250" id="FlashVars_AS2" align="middle">
<param name="movie" value="MuShagPlayer.swf" />
<param name="quality" value="low" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="always" />
<param name=FlashVars value="surl=http://www.mp3hungama.com/music/audio/Indian/Indian%20Movies/3G%20(2013)/songs/Kaise%20Bataaoon%20@%20Mp3HunGama.Com.mp3&waveform=${waveform}&tle=${songTitle}&sId=${songId}" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="MuShagPlayer.swf" width="1000" height="250">
<param name="movie" value="MuShagPlayer.swf" />
<param name="quality" value="low" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="always" />
<param name=FlashVars value="surl=http://www.mp3hungama.com/music/audio/Indian/Indian%20Movies/3G%20(2013)/songs/Kaise%20Bataaoon%20@%20Mp3HunGama.Com.mp3&waveform=${waveform}&tle=${songTitle}&sId=${songId}" />
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</object>
</object>
回答by Fendy Pratama
May you can edit from:
您可以从以下位置进行编辑:
<param name="play" value="true" />
became:
变成了:
<param name="autoplay" value="true" />
i have try it and then successed.
我试过了,然后成功了。