peroxide
peroxide

Reputation: 696

Flash embedded in HTML doesn't appear in Chrome

When i embed a flash video in HTML it works in IE and in Firefox but not in chrome. I've looked it up and I've found that chrome adds two attributes to the embed tag, width and height. i have already set the width and height attribute in the embed tag in pixels but from some reason chrome changes it to percentage. when i inspect the element and write pixels instead of percentage the flash is visible again.

This is the embed

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"
width="600" height="1300">
<param name="src" value="flash.swf" />
<param name="wmode" value="transparent" />
<embed type="application/x-shockwave-flash"
 width="600px" height="1300px" src="flash.swf"
 wmode="transparent">
</embed>
</object>

How can i fix it?

Upvotes: 5

Views: 28044

Answers (6)

Jose De Gouveia
Jose De Gouveia

Reputation: 1042

i know is an old post , but i ran to this problem too and i found a solution, when you embed a video in worpress, use just the "embed" tag, because it seems that google chrome when its read the "object" tag, skips the tags inside ,

OLD CODE

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"   codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" width="600" height="1300"><param name="src" value="flash.swf" /><param name="wmode" value="transparent" /><embed type="application/x-shockwave-flash" width="600px" height="1300px" src="flash.swf" wmode="transparent"></embed></object>

NEW CODE

<embed type="application/x-shockwave-flash" width="600px" height="1300px" src="flash.swf" wmode="transparent"></embed>

Also as suggested by @joshuahedlund and probably the right answer , just adding the type seems to fix the issue

<object type="application/x-shockwave-flash" ... > ... </object>

Upvotes: 9

hostinginca
hostinginca

Reputation: 11

This code work in all browsers (iexplore, firefox, chrome,..), You can try http://civiro.com

<object type="application/x-shockwave-flash" 
width="740" height="470" data="civiro.swf">
<param name="movie" value="civiro.swf">
</object>

Upvotes: 1

frattaro
frattaro

Reputation: 3421

After grappling with uploadify, I found that IE9 needs the classid attribute, but Chrome breaks with it. There's no non-js/non-server side code way of doing it with that in mind. If you declare it twice (with/without classid) it'll work in IE and Chrome but show two copies in firefox.

Upvotes: -1

ptkoz
ptkoz

Reputation: 2507

Why don't you try proper

width="600" height="1300" 

instead of

width="600px" height="1300px" 

(which is not in HTML standard)?

Upvotes: 1

triemstr
triemstr

Reputation: 21

I posted a solution on the bottom of this page: Embedded Flash not working in Google Chrome?

I had problems having the movie and src parameters when using chrome. I thought chrome would ignore them (since they are only there for IE I think) but it doesn't.

See if this works in your html code:

<!--[if IE]>
  <param name="src" value="flash.swf" />
<![endif]-->

and leave the rest the same. Let me know if it works for you since I'm curious. I eliminated the src parameter in javascript.

Upvotes: 0

KBoek
KBoek

Reputation: 5985

I've used this javascript code snippet for a while and it seems to work find in most browsers. You'll need the AC_RunActiveContent.js for this, download it from http://www.adobe.com/devnet/activecontent/articles/devletter.html

<script type="text/javascript">
AC_FL_RunContent(
'id', 'mediaPlayer',
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
'width', '480',
'height', '360',
'src', 'myFlashMovie.swf',
'quality', 'high',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'align', 'middle',
'play', 'true',
'loop', 'true',
'scale', 'showall',
'wmode', 'window',
'devicefont', 'false',
'bgcolor', '#000000',
'name', 'mediaPlayer',
'menu', 'true',
'allowFullScreen', 'true',
'allowScriptAccess', 'sameDomain',
'movie', 'myFlashMovie.swf',
'salign', '');</script>

Upvotes: 2

Related Questions