I’m embedding youtube clips on my site with the following code:
<object width="259" height="215" style="margin:auto; width:262px; height:217px; position:relative;">
<param name="movie" value="http://www.youtube.com/v/<?php echo $yt_id; ?>&hl=en&fs=1&rel=0&hl=en&fs=1&rel=0&showinfo=0&autoplay=1"></param>
<param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param>
<embed src="http://www.youtube.com/v/<?php echo $yt_id; ?>&hl=en&fs=1&rel=0&hl=en&fs=1&rel=0&showinfo=0&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="259" height="215"></embed>
</object>
<p style="margin-top:12px; width: 259px; text-align:center;"><?php echo $yt_title; ?></p>
which works great in html5 equipped or flash equipped browsers. However, if i try using IE 7/8 without flash installed, i get this placeholder:
how can i get a “this video requieres flash player” instead?
update: this is my final code using Richard JP Le Guen’s solution. it works perfectly.
<object width="259" height="215" style="margin:auto; width:262px; height:217px; position:relative;">
<param name="movie" value="http://www.youtube.com/v/<?php echo $yt_id; ?>&hl=en&fs=1&rel=0&hl=en&fs=1&rel=0&showinfo=0&autoplay=1" />
<param name="wmode" value="opaque" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="http://www.youtube.com/v/<?php echo $yt_id; ?>&hl=en&fs=1&rel=0&hl=en&fs=1&rel=0&showinfo=0&autoplay=1" allowfullscreen="true" width="259" height="215">
<param name="wmode" value="opaque" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer" style="display: block; text-align:center; padding-top:40px;">
<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>

This looks like the sort of thing one uses SWFObject for.
With SWFObject, you add the
<object>and<embed>dynamically, using JavaScript. In your (normal, standards-compliant) HTML you would have a message like “You need Flash and JavaScript to view this video” and then use SWFObject to swap out that content for the video.A quick Google search for SWFObject and YouTube yielded this article. I don’t have time to read it, but it looks like it could help.