Best Youtube embed player sizes?

Posted by Xeoncross on Stack Overflow See other posts from Stack Overflow or by Xeoncross
Published on 2010-04-11T17:48:49Z Indexed on 2010/04/11 17:53 UTC
Read the original article Hit count: 577

Filed under:
|
|
|

I use tumblr to share videos and, unfortunately, when re-posting a video to your tumblelog it uses the embed code at 400x336px. This is neither widescreen nor very large.

So I'm trying to set the player to better size and I'm finding that the youtube player really comes in many sizes. For example, when copying the embed code for and HD video I get the sizes 560x340, 640x385, and 853x505. Then when I look at the embed code for a SD video I get the sizes 425x344, 480x385, and 640x505.

I was having the best luck with setting the player to 640 x 505 as it was large enough for HD and perfect for SD.

print str_replace( array('400', '336'), array('640', '505'), $video_player_html); 

Has anyone dealt with trying to find a good standard embed size for a site? One thing that would make this a lot easier is to know whether the video was HD or not - however, that info is not provided in the embed code.

I guess I am actually more interested in knowing the right ratio (or specific size) to use that works the best for youtube's mixed content.

© Stack Overflow or respective owner

Related posts about youtube

Related posts about embed