HTML and CSS Reference
In-Depth Information
If you've ever looked at a YouTube video anywhere else but the YouTube site, you've seen the combi-
nation <object> and <embed> tags in action. All of YouTube's code for embedding one of its hosted
videos uses this method. Here's an example:
<object width=”640” height=”385”><param name=”movie”
value=” http://www.youtube.com/v/t-Sm4kTUGCc?fs=1&amp;hl =en_US&amp;rel=0”>
</param><param name=”allowFullScreen” value=”true”></param>
<param name=”allowscriptaccess” value=”always”></param>
<embed src=” http://www.youtube.com/v/t-Sm4kTUGCc?fs=1&amp;hl =en_US&amp;rel=0”
type=”application/x-shockwave-flash”
allowscriptaccess=”always” allowfullscreen=”true” width=”640”
height=”385”></embed></object>
Though the movie's web address (the value attribute in the <param> tag and src attribute in the
<embed> tag) is somewhat convoluted, you can clearly see the two major tags combined.
The sharp-eyed reader may have spotted the closing </embed> tag in the YouTube
code. Although it is not required, some developers — including YouTube, obvi-
ously — continue to add it for supposed browser compatibility. The closing tag
is ignored by all modern browsers, so you can use it or not as per your preference.
inserTinG an swF FiLe
The Adobe Flash Player is certainly one of the most popular plug-ins available. The Flash Player's
ability to play SWF files created by Adobe Flash and other authoring programs expands the creative
professional's palette extensively. An SWF file portrays an animation, drives a sophisticated applica-
tion, and even — in specialized versions — displays full-screen video.
If you don't have the latest Flash Player installed, you can — and should — get it
at http://get.adobe.com/flashplayer .
If you're creating your own Flash-generated content, you can use Flash itself to publish an HTML
page, complete with all the required code, to host the content. On the other hand, if you're insert-
ing an SWF created by someone else, you'll need to know a few key values. Here's an example code
block that uses the combined tag method for working with plug-in content:
<object classid=”clsid:d27cdb6e-ae6d-11cf-96b8-444553540000”
codebase=” http://download.macromedia.com/pub/shockwave/cabs/
flash/swflash.cab#version=10,0,0,0”
width=”1000” height=”260” id=”Traced Bird FMA” align=”middle”>
<param name=”allowScriptAccess” value=”sameDomain” />
<param name=”allowFullScreen” value=”false” />
<param name=”movie” value=”Traced Bird FMA.swf” />
Search WWH ::




Custom Search