How to Embed Video with Valid HTML 2

By Xah Lee. Date: ,

This page shows you how to embed a video with valid HTML.

For examples of YouTube, Dailymotion, and discussion, see How to Embed Video with Valid HTML.

tudou.com (土豆网) Example

Incorrect

<embed src="http://www.tudou.com/v/9OoINUl31dQ/v.swf"
 type="application/x-shockwave-flash"
 allowscriptaccess="always"
 allowfullscreen="true"
 wmode="opaque"
 width="480"
 height="400"></embed>

Correct

<object
 type="application/x-shockwave-flash"
 data="http://www.tudou.com/v/9OoINUl31dQ/v.swf"
 width="480"
 height="400">
 <param name="movie" value="http://www.tudou.com/v/9OoINUl31dQ/v.swf">
</object>

Redtube Example

Suppose you want to embed the video 〔http://www.redtube.com/7291〕 of a porn website. If you click on their widget, it gives you this markup:

Incorrect

<object height="315" width="434">
<param name="movie" value="http://embed.redtube.com/player/">
<param name="FlashVars" value="id=7291&style=redtube">
<embed src="http://embed.redtube.com/player/?id=7291&style=redtube"
pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash"
height="315" width="434">
</object>

The above is not valid. The following is a valid equivalent:

Correct

<object type="application/x-shockwave-flash"
data="http://embed.redtube.com/player/?id=7291&amp;style=redtube" width="434" height="315">
<param name="FlashVars" value="id=7291&amp;style=redtube">
<param name="movie" value="http://embed.redtube.com/player/?id=7291&amp;style=redtube">
</object>

In this case, we used 2 “param” tags. The one with the “FlashVars” is necessary, else redtube won't load the video. The one with the “movie” is again just for IE.

Like what you read? Buy JavaScript in Depth
or, buy something from my keyboard store