kudago / oembed-all

jQuery-less, CommonJS library for JavaScript oEmbed usage
https://github.com/kudago/oembed-js
33 stars 8 forks source link

Oembed-all unstable

CommonJS fork of jquery-oembed-all, jquery-less.

$ npm install --save oembed-all
var Oembed = require('oembed-all');

or connect oembed.js and write the same thing to get the function. Then you can call it like that:

<a href="http://www.youtube.com/watch?v=8mwKq7_JlS8" class="embed"></a>

<script>
  var link = document.querySelector('a.embed');
  var oembed = new Oembed(link, options);
</script>

Shortened Urls

This project now handles shortened url's using the JSONP service from http://longurl.org. e.g. http://bit.ly/oP77mm will first lengthen the URL to http://tinychat.com/omginternetparty and then embed as normal. This is experimental - so let me know of problems!

to use...

<a href="https://github.com/starfishmod/jquery-oembed-all" class="oembed">https://github.com/starfishmod/jquery-oembed-all</a>
  1. url
  2. options
new Oembed(link, {
    embedMethod: 'auto',    // "auto", "append", "fill"
    apikeys: {
        amazon : '<your amazon key>',
    }
});

Fallback to Open Graph

If no providers are found, the fallback (opengraph) provider will scrap the intended website using YQL to try to embed information using the OG protocol.

The fallback can be disabled using {fallback:false} setting.

new Oembed(link, {
        fallback : false
    }
});

Current 3rd party sources include:

Video

Audio

Photo

Rich

TODO:

Plus a lot more :) Feel free to submit

NPM