views:

530

answers:

2

Hello, I'm using the following code...

<object width="425" height="344"><param name="movie"
value="**URL**"></param><param name="allowFullScreen"
value="true"></param><embed src="**URL**" type="application/xshockwave-
flash" allowfullscreen="true" width="425"
height="344"></embed></object>

to display a youtube video. It works in Firefox, but not in IE. I'm a total noob to webdevelopment, so I'm running into all these wonderful inconsistencies that you veterans are used to ;)

Thanks in advance for all your help!

+4  A: 

Try this:

<object type="application/x-shockwave-flash" data="VID_URL" width="425" height="344">
    <param name="movie" value="VID_URL" />
</object>
Farid
that did it, thanks so much!
BeachRunnerJoe
Thank you so much. I was searching really hard to find a solution for it and there it is.
Izabela
+1  A: 

To elucidate, it doesn't work because the object tag is incomplete. Firefox gives up on the object element and uses the fallback old-school embed element instead. IE doesn't support embed so you get nothing.

An object element must at least have a type attribute telling it what plugin to use and a data attribute telling it what to send the plugin. In IE you also need to mirror the data attribute in a <param name="movie"> value inside the object because it runs plugins differently.

IE won't ‘stream’ partially-loaded Flash files this way though. To get that, you have to use an ActiveX classid instead of the type to tell it which plugin to use. If you care about this (and you might not: for small files, stub loaders, and files that are useless until complete, it makes no difference) then you have to start serving combinations of nested objects or embeds, which quickly becomes confusing.

bobince