Updated Every Monday, Wednesday and Friday

Wednesday, June 03, 2009

Posting YouTube Videos To Your Blog: A Primer

Posting YouTube videos into your Blogger/Blogspot posts these days tends to be more of an Art than a Science as the default values for the video size make our Blogger templates choke and gag in their attempts to contain it all.

So, what do we do? We get creative - see YouTube's actually done us all a favour in that we can actually specify the size of the video we want to embed.

Normally, what you end up getting is something like this:


Not very template friendly, right?

What we're looking for in the embed code is the two instances of this (easiest to edit if you switch over to 'Edit HTML' mode in the Create window):

Object width="450" height="344"

(you'll need to change both versions of height and width for this to work).

See, most of the blogger templates don't allow for objects much wider than 400 pixels - inserting something larger causes the object to bust out of the sides and generally make your blog look all awkward and crap-tastic.

So, easy fix: All you have to do is take the Width number and change it to 400 or less - making sure to compensate by lowering the Height by around 30-60 pixels. I've realized I like the look of Width = 400 and Height = 230... but that's my taste.

Here's what it looks like when optimized for your blog:


(Note: unfortunately this video didn't scale down all that well, but for most HD videos this works perfectly - to get rid of the extra black on the sides, reduce the total Width even more - probably for this video I'd put it closer to 350)

Cheers!
Brandon

1 comment:

Peter said...

Or you can just switch to worpdress and let it do it for you ;)