April 09, 2007

HOW TO EMBED YOUTUBE VIDEOS - UPDATED 4-9-07 9:45AM

Everybody else does it, and I wanted to do it to, but couldn't figure out how. When I tried clicking the "post this video" link at YouTube, it didn't list Movable Type as an option, plus they wanted my blog password.

Looked kinda like a dead end.

UPDATE 4-9-07 9:45AM: Blogson Contagion of Miasmatic Review points out in the comments that the embed code is actually provided in the box just to the right of the video at the YouTube site. Looks like I wrote all this for nothing.

So I found someone with an embedded YouTube video, looked at the source code, and figured out what to do.

The embedded source code looks like this [bolding added by me]:

<p><object height="350" width="425"><param name="movie" value="http://www.youtube.com/v/gNqiSkd1M6k"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/gNqiSkd1M6k" type="application/x-shockwave-flash" wmode="transparent" height="350" width="425"></object></p>

A typical YouTube URL looks like this [bolding added by me]:

http://www.youtube.com/watch?v=yPxzsFRPQd0

In order to embed a YouTube video, just replace the bolded parts of the embedded source code with the bolded part of the YouTube URL, then put the new embedded source code in your post.

Like this smart dog fetching a tennis ball (link e-mailed to my by Beloved Wife TNT of Smiling Dynamite):

Anyway, here's the plain text version of the code. Just replace the "VIDEO ID" part:

<p><object height="350" width="425"><param name="movie" value="http://www.youtube.com/v/VIDEO ID"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/VIDEO ID" type="application/x-shockwave-flash" wmode="transparent" height="350" width="425"></object></p>

Blogger Note: I had trouble getting a video to post at Blogger because it said I was missing a closing tag for the <embed> opening tag. I stuck one in toward the end and it seemed to work fine. Thus:

<p><object height="350" width="425"><param name="movie" value="http://www.youtube.com/v/VIDEO ID"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/VIDEO ID" type="application/x-shockwave-flash" wmode="transparent" height="350" width="425"></embed></object></p>

NOTE: [If you've found this post useful enough to blog about, send a trackback or e-mail the permalink to me at harvolson-at-gmail.com and I'll add you to my Bad Example Groupies blogroll. See this post for details]

posted by Harvey on April 9, 2007 at 06:29 AM | Permalink | 6 Liars | TrackBack | Blogging Tips
Trackbacks to HOW TO EMBED YOUTUBE VIDEOS - UPDATED 4-9-07 9:45AM
TrackBack URL for this entry:
http://blog2.mu.nu/cgi/trackback.cgi/208538
Comments on HOW TO EMBED YOUTUBE VIDEOS - UPDATED 4-9-07 9:45AM
Pete Fanning exemplified on April 9, 2007 06:29 AM

The ONLY caveat is that in a win32 RSS reader (I only know about FeedDemon, don't know about others), videos don't tend to come through in the post.

Now on some of the ONLINE RSS readers, they do.....I believe I've seen it work in Google's RSS Reader.....

Contagion exemplified on April 9, 2007 08:30 AM

As a person that annoyingly posts YouTube videos all the time I feel compelled to point out that usually in the right sidebar there is a code that says labeled embed. All you have to do is copy and past that code onto your editor. I usually add the Center HTML just to make it look prettier, but you don't need to.

Contagion exemplified on April 9, 2007 08:33 AM

It's early.. the above is filled with typos and just incomplete thoughts. Excuse my lack of awakeness.

Past=Paste

And: There is a code that is labeled embed.

Harvey exemplified on April 9, 2007 08:43 AM

I *thought* there had to be an easy way to do it.

Somehow I always managed to overlook that embed code.

Harvey exemplified on April 9, 2007 08:44 AM

So why do they have that "post video" link?

Contagion exemplified on April 9, 2007 05:11 PM

Myspace.