Easy YouTube embeds with custom dimensions?
March 9, 2010 9:21 AM   Subscribe

Is there a site or service that offers a quick and easy way to get embed code for a YouTube video at any given pixel width?

I like how Vimeo lets me specify a preferred width for embedded videos, and remembers my preference, so that when I use their videos on my site, they always fit my layout perfectly.

YouTube's default widths, for my purposes, are either too narrow at 480px or too wide at 560px. Strangely enough, I want 510px, right smack in the middle of their defaults.

I know I can manually edit the code to make them fit, but it's not convenient. Is there a site out there that I can paste a YouTube URL into, along with my desired size, and have it spit out a custom embed code?

My Googling led me to VTubeTools, but it's a bit much and requires me to specify height as well as width, which is no more convenient than editing the code myself. Ideally what I want is to only have to specify the YouTube URL and desired width. The height should automatically be generated based on the original aspect ratio of the video.
posted by Robot Johnny to Computers & Internet (3 answers total)
Best answer: It's not pretty, but here's one I put together in PHP.
posted by the biscuit man at 1:20 PM on March 9, 2010

Response by poster: Brilliant! The generosity of MeFites never ceases to amaze me. Thanks!
posted by Robot Johnny at 2:30 PM on March 9, 2010

Glad to help. Love your work by the way.
posted by the biscuit man at 8:59 AM on March 10, 2010

« Older Is my new relationship with my ex a terrible idea?   |   Montreal restaurants for event Newer »
This thread is closed to new comments.