Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: how to embed YouTube-Video into main Blog ?

The embed element is deprecated in XHTML 1.0. Only Netscape needed it (R.I.P.).

This element will invalidate your markup. But then so will a lot of other WP output.

YouTube video links are troublesome, but once you get it figured it’s easy to knock up a template where you can just paste-in the URL. If your site always shows videos at the same size, write a simple PHP function that accepts the ID of the video as a parameter (in the snippet below, thats ‘uOzrZMhf7Ig’).

Here’s an example I know works:

<object width="425" height="344" type="application/x-shockwave-flash" data="http://www.youtube.com/v/uOzrZMhf7Ig&hl=en&fs=1&rel=0&border=1">

<param name="movie" value="http://www.youtube.com/v/uOzrZMhf7Ig&hl=en&fs=1&rel=0&border=1" />

<param name="allowFullScreen" value="true" />

<param name="allowscriptaccess" value="always" />

</object>

The data attribute on the object is required. The allowFullScreen parameter is required if you use the &fs=1 (enable full-screen button) query arg.

Notice also that the query args are escaped.

A very useful page – YouTube APIs and Tools – YouTube Embedded Parameters.

HTH

Skip to toolbar