Resizing Your YouTube Movies

youtube-logo

Adding a YouTube movie to your website is super easy – we all know that… But what if you want to customize the size of your movie so that it fits elegantly within the parameters and style of your site, then what?

I have a nice little formula for you that will help you resize any movie for you.

You see, it isn’t enough to just change the width of your movie – you must adjust the height too. But in order to keep the aspect ratio of the movie  intact (we don’t want to stretch, squish it or have a huge black border) we must reduce the height the same percentage as the width – but how?

Let’s take a look at a YouTube embed code:

<object width=”640″ height=”385″><param name=”movie” value=”http://www.youtube.com/v/hbnUbXX-8L0&hl=en&fs=1&”></param><param name=”allowFullScreen” value=”true”></param><param name=”allowscriptaccess” value=”always”></param><embed src=”http://www.youtube.com/v/hbnUbXX-8L0&hl=en&fs=1&” type=”application/x-shockwave-flash” allowscriptaccess=”always” allowfullscreen=”true” width=”640″ height=”385″></embed></object>

I have highlighted (in BOLD PINK) two places where you  will have to change the height and width information.

Say our center (content) column is 529 pixels wide, we can easily change the width from width=”640″ height=”385″ to width=”529” height=”385″ pixels. That’s the easy part – now how do we figure out the correct height?

If we only change the width, the movie looks like this:

Not elegant, big ugly black border… (FYI – I was the 1st Assistant Director on this Music Video).

We need to do a little math – wait don’t be scared, don’t even think of it as math – it is simply a system that will work every time. When you put your key in the ignition and turn it and your car starts, you don’t (I am guessing) ask why – you are simply happy that it works – do the same here.

Here’s what we do. First we find out what we know. We know (in this example) that the YouTube movie is  640 pixels wide and we also know that our center column is 529 – our movie must be only 529 pixels to properly fit on our page.

Here’s the math: We divide 640 by 529 to get a ratio of the difference. 640 divided by 529 equals 1.21. So to figure out the correct height we simply divide the current height by 1.21 to get our new height. 385 divided by 1.21 equals  318.

Easy right? The correct height of our movie is: 318. Now let’s take a look at the new code:

<object width=”529″ height=”318″><param name=”movie” value=”http://www.youtube.com/v/hbnUbXX-8L0&hl=en&fs=1&”></param><param name=”allowFullScreen” value=”true”></param><param name=”allowscriptaccess” value=”always”></param><embed src=”http://www.youtube.com/v/hbnUbXX-8L0&hl=en&fs=1&” type=”application/x-shockwave-flash” allowscriptaccess=”always” allowfullscreen=”true” width=”529″ height=”318″></embed></object>

This will work every time. To summarize:

  1. Always start with an embed code that has the width of the movie wider than you need
  2. Divide the original movie width by the width of your page.
  3. Divide the original height by the answer in number 2.
  4. Replace the width and height in both place in your embed code.

When we do the math, the video looks like this:

If you found this post helpful, please leave a comment or tweet about it. Thanks,

Lennie

Tags: , , ,

2 Responses to “Resizing Your YouTube Movies”

  1. Debby Bruck says:

    You are a genius, Lennie. Small wonders.

    be well
    Debby

Leave a Reply

 

 

 

 

 

 

 

online business starter kit

small business solutions - FreeMarket Media Group Starter kit   small business solutions - FreeMarket Media Group Starter kit
 

FREE Report Reveals 10 WEB Marketing Secrets

FMMG Starter Kit

The FreeMarket Media Group Starter kit contains nearly 20 pages of proven online marketing insights and strategies to help you get your Internet business off and rolling. Whether you are an offline business wanting to take your business online successfully or you already have an established online presence, this e-book is for you.


First Name * small business marketing
E-Mail * small business marketing
 
small business solutions - FreeMarket Media Group Starter kit   small business solutions - FreeMarket Media Group Starter kit

 

featured small business websites
web design and business marketing web design and online business marketing web design and business marketing web design and business marketing web design, internet commerce  and business marketing web design and business marketing web design and business marketing web design and business marketing

 

 

 

 

Follow me on Twitter    connect on faceboock     connect on LinkedIn     connect on youtube

 

 

 

 

wordpress special - the right choice for doing business online
If you aren't using a blog, then you are missing the most dynamic opportunity in HISTORY do drive customers to ANY BUSINESS! WordPress makes this easier than ever.

The time is now to get yourself online, with an amazingly simple system that allows you to take full control fo your website. Doing business online has never been easier! We'll arm you with you own WordPress blog, 31+ templates and a handful of tools to get you started right away. What are you waiting for? Read more...

wordpress for doing business online

 

Wordpress beginners guide - how to blog
wordpress how-toFor the 1st time, you can get FMMG's WordPress 2.7 User's Guide. Taking the hard work out of the learning curve.

By using this easy-to-follow WordPress guide you will learn all the tips and tricks needed to understand all the ins and outs of WordPress. This E-book is a beginner's step-by-step guide to using WordPress to leverage your expertise using the sheer power of the Internet to bring traffic (read: interested buyers/customers) to your site. Read more...

 

marketing and web design testimonials
When I decided to put a website up I never thought I'd actually get business from it. I started working with Lennie on the design and he understood what I wanted so effortlessly. In no time my site was working for me as I never imagined possible. And when I don't know what I need but know what I'd like to see happen, he jumps in with the latest on marketing and e-commerce tools that we can put in place. I consider Lennie to be a trusted advisor, and key to my ability to reach the people who need to know about my services.

daisy swan Daisy Swan, MA, CPCC
Strategy Advisor and Coach
11812 San Vicente Blvd. Suite 505
LA, CA 90049
310-820-8877
www.daisyswan.com
© 2008 FreeMarket Media Group | Privacy Policy | Anti-Spam Policy