开发者

Embedded Flash not working in Google Chrome?

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?

 <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">
                        &l开发者_如何学JAVAt;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>


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.


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" />


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.

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.

Hope this helps.

Kevin


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


You may try like this, as i am also using Flash in Chrome but for that i have used Both as here

<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>


May you can edit from:

<param name="play" value="true" />

became:

<param name="autoplay" value="true" />

i have try it and then successed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜