Cleaning Up Our Embeds
October 30th, 2009 | Published in Youtube API
For the longest time, official YouTube video embed codes have contained embarrassingly malformed URLs; the first URL parameter (at the end of URLs) should always start with a ? character, but our URL parameters begin with &. That looks something like this:
http://www.youtube.com/v/0XjwoVqM_qE&feature=player_embedded&fs=1 (incorrect)
http://www.youtube.com/v/0XjwoVqM_qE?feature=player_embedded&fs=1 (correct)
Fortunately, we've found a way to use correct URLs without breaking old browsers and we can't wait to do it.
Speaking of changes to the embed code, we'll also be tweaking the HTML content. The new YouTube embed code is leaner and still works on everything from ancient desktop browsers to modern smart phones. You won't find another snippet of HTML that's as battle-tested and mother-approved! Here's a preview of the new, streamlined format:
And here's what the HTML looks like:
If you grab YouTube embed codes by hand from YouTube.com, or from the YouTube Player APIs or oEmbed, you'll start getting this updated HTML soon. As for all the embeds already on the web: worry not, those will continue to work forever.