Display Videos in Proper Ratio
Let’s say you want to display a YouTube video within your blog post but you want to expand the size of the video all the way. You can’t just resize it by extending the width and height of the video size to random sizes. You actually have to use algebra to keep the the right aspect ratio so your video will display correctly.

Let’s look at a sample YouTube embedding code. As you can see from the code below, the width is 425 and the height is 350.
<object width="425" height="350">
<param name="movie" value="http://www.youtube.com/v/B6w9Bo3ihrU"></param>
<param name="wmode" value="transparent"></param><embed
src="http://www.youtube.com/v/B6w9Bo3ihrU" type="application/x-shockwave-flash"
wmode="transparent" width="425" height="350"></embed>
</object>
From the drawing above we want to have the video extended 480 pixels in width from the original 425 pixels. To do this we use basic algebra to get our numbers which is directly proportional to the original sizes.
We use simple math to multiply the the new width we want, 480, by the old height, 350. Then we divide that value by the old width, 425, to get our new and final height of 395.

So your new code should look like the following.
<object width="480" height="395">
<param name="movie" value="http://www.youtube.com/v/B6w9Bo3ihrU"></param>
<param name="wmode" value="transparent"></param><embed
src="http://www.youtube.com/v/B6w9Bo3ihrU" type="application/x-shockwave-flash"
wmode="transparent" width="425" height="350"></embed>
</object>
Same Thing with Images
Don’t be surprised, but you could use this method with images so your images will not look distorted. With basic algebra, in calculating proportions, you can display your images in the right ratio so it’ll be displayed well on your blog.
I hope this helps. What do you guys think?
|
12 Responses
DerekBeau
June 28th, 2007 at 3:16 pm
Kind of basic, but definitely a technique that should be used. Messing up aspect ratios is never a good thing to do.
Sunny
June 28th, 2007 at 3:17 pm
yeah i know, but a lot of bloggers don’t use it
jarleh
June 28th, 2007 at 6:40 pm
I have not been using it. But I will now.
Thanks.
Sunny
June 28th, 2007 at 8:45 pm
you’re welcome
Bryce
June 29th, 2007 at 2:15 am
My blog design is about 5px to thin for the default YouTube size so I have to make mine smaller.
Charles Lau - Internet Business Review
June 29th, 2007 at 12:37 pm
oh i don’t really change my width and height.. somehow the standard size fits correctly so that i can just focus on bringing in contents
Sunny
June 30th, 2007 at 3:21 am
@Bryce: yeah i think this method will work for you if your picky about sizing the videos
@Charles: yeah, most of the blog templates are designed perfect for YouTube video sizes
kanak
June 30th, 2007 at 8:08 am
Hey instead of breaking my head in calculation, I prefer dragging the picture in the photoshop and let it do the rest. I have also changed the video size of youtube to 500 * 412 , as this was the ratio decided by photoshop.
zaki
June 30th, 2007 at 9:56 am
wow….thanks for the secret dude…
need to use some of my left side brain…usually occupied with some chem eng info of mine…
Sunny
July 1st, 2007 at 3:19 pm
@Kanak: The method is basically for videos because I use Fireworks to adjust the image pixels
@zaki: lolz, thanks, but it’s simple algebra
Ken Xu
July 4th, 2007 at 2:05 am
I never touch this section. Nice tips. I should do notice this from now…
Sunny
July 4th, 2007 at 1:40 pm
thanks
RSS feed for comments on this post · TrackBack URI
Leave a reply
Great Links
Categories
Archives
Top Commentators
clicker (12)alvin (2)
prolan5 (2)
derf (1)
emoteratzki (1)
Bledabbed (1)
ADBRITE (1)
prolan3 (1)
Vasyu (1)
About Me
Subscribe
Calendar
Recent Readers
Great Posts
How to Make Money with Low Blog Traffic, No BSHow to Make Money from YouTube
Indian Guy Gets Caught Cheating on His Wife on the Radio
2x, 3x, or Even 4x your AdSense Earnings, Guaranteed!
Start Getting LinkBacks Effectively, No BS
Recent Entries
Recent Comments
Most Commented
Blogging with Desi Baba is proudly powered by WordPress - BloggingPro theme by: Design Disease
Rice Bowl Journals Best of Indya