Tuesday, August 9, 2011

Embedding YouTube (or other service provider) Videos

As part of what may be called The Shanty Strikes, a number of folks have been posting some pretty sweet videos. I especially like the past couple of music videos from Girls and Wugazi. I have been asked by a couple of folks how to make sure that these super sweet videos fit into The Shanty screen. You may have even noticed this same issue in your own videos, but just didn't want to say anything.

It's a quick fix. When you post a YouTube video in a New Post, you are copying and pasting the embed code available at YouTube into the "Edit Html" field. The dimensions in YouTube's embed codes are often pretty large, particularly with respect to the width of the video. For instance, the Uff! video just posted today is about 560 pixels wide, by default. I've estimated that the space allotted for Blogger posts is about 400 pixels wide. You can reduce the width of embedded YouTube videos by editing the embed code. With the Uff! video, the default code reads:

<...height="349"width="560".../iframe>

By reducing the dimensions of the video (the "height" and "width") in proportion to the space alloted by Blogger...

<... height="250"width="400".../iframe>

...you can ensure that the entire video appears in the Blog Post. I also use as a general rule of thumb that a height of 333 pixels and a width of 400 pixels works for most videos, though the dimensions may appear a little off, depending.

Hope everyone finds this useful!

No comments:

Post a Comment