real cool tv
YouTube - changing embeded player sizes
Want to re-size your YouTube player and avoid those pesky black bars top and bottom of your custom player?

black_barsIf you mess with the YouTube embed you often get a situation like this one with big black bars top and bottom.

It can be simply avoided with a bit of maths, or a visit to a 16:9 ratio calculator site such as this one

When you copy the YouTube embed code it has a height and width. You need to alter them both in the same proportions. Our movies are shot 16:9 i.e. for every 16 pixels it is wide it is 9 high.






So if you select one of the YouTube embeds from the dialogue box on YouTube:

embed

You will notice that the ratios are all 16:9 plus 25 pixels for the player bar. There is even a handy "custom" calculator if you are in a hurry.

To calculate your own custom sizes away from Google you need some really simple math.

If the ratio is 16:9 and you want to make a 600 x something player then:

16:9 means (600/16 = something/9) or rather (600/16*9 = something). This gives you 337.5 or 338 (nothing is perfect). You can calculate this by typing 600/16*9 into Google.

Another example:

You want your player to be 580 wide. So that's (580/16*9=X). X comes out to 326.5 or 327 plus the 25 for the player.

You can also do the reverse, to get height first. If you want a 745px tall player (that's really 720 allowing for the player bar) then (X/16=720/9) or rather (X=720/9*16) which is 1280.