Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed YouTube videos while staying XHTML 1.0 Strict?

Is there a way to embed a YouTube video while still staying standards compliant (XHTML 1.0 Strict)?

Thanks in advance.

like image 383
mclaughj Avatar asked Feb 14 '09 22:02

mclaughj


People also ask

How do I add a video to xhtml?

Video clips can be placed on a Web page as hyperlinks by using the <a> tag, or can be embedded by using the <embed> or <object> tag.

Do I need permission to embed YouTube videos?

According to YouTube's Terms of Service (which applies to all users, including content providers), YouTube grants permission to access and use the site, provided that “you agree not to distribute in any medium any part of the Service or Content without YouTube's prior written permission, unless YouTube makes available ...

Why can't I embed a YouTube video?

If you receive the error message, "Embedding disabled on request” ,you have probably accidentally disabled embedding via YouTube. To grant permission again, follow these steps: Go to “Video Manager.” Select the appropriate video and click “Edit”.

How do you embed a YouTube video at a certain time?

To have a video start playing from a specific point, add “? start=” to a video's embed code, followed by the time in seconds at which you'd like the video to begin playing.


2 Answers

Flash Satay:

http://www.alistapart.com/articles/flashsatay

like image 90
Andy Hume Avatar answered Nov 03 '22 00:11

Andy Hume


There's a Tools4Noobs web page that will automatically do the conversion for you from the embed code that YouTube gives you to valid XHTML. You can choose what extra buttons appear and tweak how the border looks. It also adds a small advertising link, but that's easy to remove.

Here's an example generated by YouTube:

<object width="425" height="349">
    <param name="movie" value="http://www.youtube.com/v/AWCHdhyEdCc&hl=en&fs=1&rel=0&color1=0x5d1719&color2=0xcd311b&border=1"></param>
    <param name="allowFullScreen" value="true"></param>
    <param name="allowscriptaccess" value="always"></param>
    <embed src="http://www.youtube.com/v/AWCHdhyEdCc&hl=en&fs=1&rel=0&color1=0x5d1719&color2=0xcd311b&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="349"></embed>
</object>

Here it is converted by Tools4Noobs:

<object type="application/x-shockwave-flash" style="width:425px; height:349px;" data="http://www.youtube.com/v/AWCHdhyEdCc?rel=0&amp;fs=1">
    <param name="movie" value="http://www.youtube.com/v/AWCHdhyEdCc?rel=0&amp;fs=1" />
    <param name="allowFullScreen" value="true" />
</object>
<div style="font-size: 0.8em"><a href="http://www.tools4noobs.com/online_tools/youtube_xhtml/">Get your own valid XHTML YouTube embed code</a></div>

Just remove the <div> at the end to get rid of the advertising link, and you're done.

like image 34
Don Kirkby Avatar answered Nov 02 '22 22:11

Don Kirkby