A fork with improvements of the jquery-oembed project
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 15 commits ahead, 2 commits behind starfishmod:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



This is a fork (with a lot of changes) of the jquery-oembed located at http://code.google.com/p/jquery-oembed/.

Instead of using oohembed or other such services it tries to embed the object natively without having to use some kind of local server. This project will happily use native oembed services when it can, however it also use other types of embedding whenever oembed is not possible.

Using the Open Graph protocol (http://ogp.me/) over Yahoo's YQL (http://developer.yahoo.com/yql/), as a fallback, will display some kind of information for a lot of pages. Sites like TED, Ifixit, Ars Technica, twitpic can use this service. However some sites like bandcamp stop YQL from working because of their robots.txt file. Over time I'll be removing the some providers that have been hardcoded and using OGP instead to provide a standard embed layout and reduce the file size.

This project tries to use embedding techniques in the following order of preference:

  • oEmbed - JSONP available - e.g. flickr, meetup etc
  • embedding (IFRAME/Object) based on URL information - e.g. youtube
  • oEmbed - JSONP not Available - use YQL to correct - e.g. Ustream, viddler
  • OGP over YQL - used as a fall back.
  • YQL Screenscape to get embedding details
  • YQL Screenscrape - e.g. pastie
  • JSONP Api lookups Source - With HTML and CSS built in this project - e.g. github, Myspace, Facebook
  • Shortened URLs via longurl.org

Quick Start

Add class="embed" to the element you wish to embed: <a href="http://www.youtube.com/watch?v=8mwKq7_JlS8" class="embed"></a>

Call the .oembed function on the relevant elements:


The arguments for the .oembed function are:

  1. URL to override the detected href attribute if needed
  2. An options hash
$(".embed").oembed(null, {
    embedMethod: 'auto',	// "auto", "append", "fill",
    startClosed: false, // toggle whether oembed containers should be visible immediately
    handleOpen: '<span class="icon-chevron-down"></span>', // show this custom text/HTML in place of the standard 'show' handle
    handleClose: '<span class="icon-chevron-up"></span>',  // show this custom text/HTML in place of the standard 'hide' handle	
    apikeys: {
      amazon : '<your amazon key>',


  • npm install .
  • npm test

Current 3rd party sources include: