Tag Archives: oembed

embed.ly supports My Opera urls

On My Opera, we started using the OEmbed specification a long time ago. The goal was to provide an easy way to get metadata information, for example from albums or pictures. Example: given a picture URL on My Opera:

http://my.opera.com/365/albums/showpic.dml?album=2721921&picture=42077711

we wanted to give our users a way to extract metadata information about that URL in an easy way. That's what OEmbed is about. So you have the following OEmbed API url:

http://api.my.opera.com/service/oembed?url=http%3A//my.opera.com/365/albums/showpic.dml%3Falbum%3D2721921%26picture%3D42077711

and the result of an HTTP GET to that URL is:

{
   "width" : "3443",
   "author_name" : "giulia-maria",
   "author_url" : "http://my.opera.com/giulia-maria/",
   "provider_url" : "http://my.opera.com/",
   "version" : "1.0",
   "provider_name" : "My Opera Community",
   "height" : "2293",
   "url" : "http://files.myopera.com/giulia-maria/albums/2721921/DSC_5396.JPG",
   "title" : "April 27, 2010. Pink jasmine or pink lilac?",
   "type" : "photo"
}

So that gives you some useful metadata if you need to embed the picture in a page of yours, or even within a widget. Various sites have been supporting OEmbed for many years now. You can see a brief list on oembed.com. However, now there's a new service called embed.ly that works as a oembed "hub", as it transparently supports URLs from many different websites.

And that includes My Opera too! Try it here:

http://api.embed.ly/embed?url=http%3A//my.opera.com/365/albums/showpic.dml?album=2721921%26picture=42077711

or try it with your favourite site.

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.