Tag Archives: content

YouTube is implementing OEmbed

That's good news. For once, we were faster than YouTube to implement something :-)
Anyway, if you look at any video page source code, you will find something like:

<link rel="alternate" type="application/json+oembed" href="http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch?v%3Da1Y73sPHKxw&format=json" title="Dramatic Chipmunk" />
<link rel="alternate" type="text/xml+oembed" href="http://www.youtube.com/oembed?url=http%3A//www.youtube.com/watch?v%3Da1Y73sPHKxw&format=xml" title="Dramatic Chipmunk" />

And, by looking at one of these URLs, for example the JSON one, you can see:

{
  "provider_url": "http://www.youtube.com/",
  "title": "Dramatic Chipmunk",
  "html": "<object width="384" height="313"><param name="movie" value="http://www.youtube.com/v/a1Y73sPHKxw&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/a1Y73sPHKxw&fs=1" type="application/x-shockwave-flash" width="384" height="313" allowscriptaccess="always" allowfullscreen="true"></embed></object>",
  "author_name": "cregets",
  "height": 313,
  "width": 384,
  "version": "1.0",
  "author_url": "http://www.youtube.com/user/cregets",
  "provider_name": "YouTube",
  "type": "video"
}

So, from now on, you don't have to guess what's the HTML code to correctly embed a YouTube video (like we on My Opera did for the Embed Video button on the new blog post form, but you have the full, and always updated, HTML code in the OEmbed JSON content.

Nice, I think.