Options

Shobhit Sharma edited this page Oct 15, 2017 · 7 revisions

The options are native and external based as described below:

Native Options

Parameter Type Default Description
width number null Custom width of container (gets ignored if not supported via SDK)
height number null Custom height of container (gets ignored if not supported via SDK)
centerize boolean true Centering rendered element to center horizontally or vertically
strict boolean false Enable or disable auto-resizing functionality

External Options

  • Facebook - Supports maxwidth, omitscript (API Reference)
  • Twitter - See Parameters section here
  • Instagram - Supports hidecaption, maxwidth, omitscript (API Reference)
  • YouTube - See Supported Parameters section here
  • Pinterest - See API Reference
  • Google Maps - Supports zoom as integer and mapTypeId as enum as roadmap/satellite/hybrid/terrain (API Reference)
  • Others/iFrame: tagName (identifier for HTML Tag, defaults to embed)

Examples

// Defaults when no option argument is passed
embedo.load(
  document.getElementById("embedo-youtube-embed"), "my://awesome/url", {
    width: null,
    height: null,
    centerize: true,
    strict: false
  }
);

// For article mode, where size or centering wont matter, use:
embedo.load(
  document.getElementById("embedo-youtube-embed"), 
  ["my://awesome/url1", "my://awesome/url2"], 
  {
    centerize: false,
    strict: true
  }
);

// Example to embed youtube video by passing native options
embedo.load(
  document.getElementById("embedo-youtube-embed"),
  "https://www.youtube.com/embed/vn2qXpcon-s", {
    width: 640,
    height: 480
  }
);

// Embeds instagram post by passing external options
embedo.load(
  document.getElementById("embedo-multiple"), [
    "https://www.instagram.com/p/BX3fMnRjHpZ",
    "https://www.instagram.com/p/BX3ejdJHmkD",
    "https://www.instagram.com/p/BX3VEDqFvmg"
  ], {
    hidecaption: false
  }
);

// Embeds pinterest profile by passing external and native options
embedo.load(
  document.getElementById("embedo-pinterest-profile"),
  "https://www.pinterest.com/pinterest/", {
    "data-pin-do": "embedUser",
    "data-pin-board-width": 750,
    "data-pin-scale-height": 500,
    "data-pin-scale-width": 80,
    "strict": true
  }
);
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.