Docs

embedo

A simple, lightweight and standalone social media content embed plugin for web

embedo.js

Bower version npm version
        
 /**
  * @implements Embedo setup
  *
  * @package npm install embedo --save
  * @package bower install embedo
  * @import https://www.jsdelivr.com/projects/embedo (via jsdelivr)
  * @import https://cdnjs.com/libraries/embedo (via cdnjs)
  * @import https://unpkg.com/embedo (source via unpkg)
  */

  import Embedo from './my/vendor/folder';

  const embedo = new Embedo({
    facebook: {
      appId: 'my_app_id',
      version: 'v2.8'
    }, // Enable facebook SDK
    twitter: true,  // Enable twitter SDK
    instagram: true,  // Enable instagram SDK
    pinterest: true  // Enable pinterest SDK,
    googlemaps: {
      key: 'my_api_key'
    } // Enables google maps API
  });

  // Calling .load() event [HTMLElement, url|string, options|object{}]
  embedo.load(
    document.getElementById('my-awesome-container'),
    'https://twitter.com/Twitter/status/849866660882206721'
  );

  // Load with native and external options
  embedo.load(
    document.getElementById('my-awesome-container'),
    'https://www.instagram.com/p/BSoJJjQA3Td/',
    {
      width: 640,
      height: 480,
      hidecaption: true
    }
  );

  // Also, the jQuery way
  embedo.load($('my-awesome-container').get(0), 'my://url');

  // Refresh event (if no element passed, refreshes all embedo instances)
  embedo.refresh(document.getElementById('my-awesome-container'));

  // Destroy event (if no element passed, destroys all embedo instances)
  embedo.destroy(document.getElementById('my-awesome-container'));

  // Event Handlers to watch element mutated, refreshed or removed
  embedo.on('watch', (event, result) => {});
  embedo.on('refresh', (result, data) => {});
  embedo.on('destroy', () => {});
        
      

What's currently supported?

Embeds Facebook URLs containing post, photos and videos
Embeds Twitter URLs containing user timeline and tweets
Embeds YouTube videos URLs, playlists will play in loop
Embeds Instagram URLs containing posts and videos
Embeds Pinterest URLs containing posts and pins
Embeds Vimeo videos URLs
Embeds Google Maps URLs containing cordinates to a location
Alternatively, embeds external web URLs into iframes