Add oEmbed support to your Meteor.js app
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

iframely:oembed for Meteor

This package adds embed codes support to Meteor through a oEmbed proxy API. The proxy is configurable, you can use Iframely (with API key), our open-source version, or any other proxy. Including implementing your own.

Quick demo:

iframely:oembed can cache oEmbeds in the database. The package also lets you optionally customize the templates used for renders (especially if the URL is link type and only has title, description and a thumbnail).


meteor add iframely:oembed



Template context should be an object with url attribute.


Configure oembed rendering widget and oEmbed api endpoint:

Meteor.startup(function() {

    // Optional client-side template. If not specified - default widget used.

    // Please configure your oEmbed proxy address. 
    // Default: `''` powered by
    // Query string parameters are fine too

    // Optionally cache oEmbeds using mongo collection. Defaults:
        cacheTTL: 1000 * 60 * 60, // Hour.
        cacheErrorTTL: 1000 * 60, // Minute.
        cacheEnabled: true

See the default base widget as example and boilerplate for template customization:

The context of the widget is the oEmbed JSON object itself. If oEmbed is loading, the temp context is:

    loading: true

If an error is encountered during oEmbed request (such as page 404s or proxy 503s), the context is set to:

    error: ErrorInstance

Alternative way to customize base widget is simply via CSS: base-widget.css

Integration example

Here is the integration diff that activates iframely:oembed in the exmaple Meteor todos application (embeds will show up if todo's text is url): meteor-todo-iframely-oembed-demo

And another simple demo app used to test package: meteor-iframely-demo.


MIT, (c) 2014 Itteco Software Corp.