Rich-content embedding for the web: time for oEmbed 2?

One of the technologies I encountered working at StatusNet that I’m very interested in bringing to MediaWiki is oEmbed, a protocol for fetching enough information about a photo or video that another web site can, reasonably sanely, drop a thumbnail view or inline video player into its own pages.

oEmbed and similar discovery systems mostly appear behind the scenes, but pop up in WordPress, Twitter, Facebook and the like to make a lot of embedding fairly transparent when you start linking to a URL with a cool photo or video on it.

Traditionally, embedding a photo or video from another site to your own requires manually copy-pasting a chunk of HTML, which is presented to you in some side option on the hosting site. The advanced video player in use on Wikimedia Commons presents such an option:

The actual code might be an <iframe>, <script>, <embed>, <object> etc depending on the player technology, but at essence it’s a blob of stuff that’s fairly opaque to most people.

There are two huge problems with this:

  1. Taking raw HTML from another site is potentially unsafe: because of this, most modern blogs, forums, wikis, and social networks don’t actually allow you to paste raw HTML in and expect it to work.
  2. Finding the embeddable HTML is nonstandard and unwieldy: you’ll find it in different places on Flickr, Youtube, and Wikimedia Commons, and there’s no consistent way for machines to find it for you.

oEmbed essentially provides a standard system for discovery of the embedding information. Given the URL to some interesting resource (a Flickr photo page, a Youtube video page) a consuming site can ask for the oEmbed API endpoint and send it a request for embedding of that resource, optionally fitting a given maximum size.

StatusNet uses this currently to fetch small thumbnails for linked photos and videos but it’s possible to go farther and embed video players etc, if you trust the provider site or have the infrastructure to run the HTML through an offsite <iframe> (giving it an isolated security context in the browser).

I’d very much like to set up a standard oEmbed provider for MediaWiki which will make it easier to expose photos, videos, and other goodies on Wikipedia, Commons, and other Wikimedia sites — especially if/when we start doing more multimedia features  like interactive maps, diagrams, physics simulations, etc which can be exposed in the same way. Adding copyright & source metadata to the embedding information would be a huge help for us, especially if we can consume info from other sites too, indicating license compatibility etc.

Currently there’s a thread on the oEmbed mailing list discussing possible improvements for a next version of the protocol, of which metadata, safer (iframe-based) arbitrary HTML embedding, and the possibility of player control APIs are so far at the top of the list. If interested in the low-level fun of embedding implementation, do feel free to stick your nose in and comment!

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>