Skip to content

troybetz/media-embed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

media-embed

embed popular media formats using noembed.com

Installation

$ npm install media-embed

Example

import mediaEmbed from 'media-embed';

/**
 * Retrieve embed element
 */

const url = 'http://www.youtube.com/watch?v=iEe_eraFWWs';
mediaEmbed(url, (err, embed) => document.body.appendChild(embed));

Usage

embed(url:string, callback:func)

Return embed data for url.

Works with every media provider listed at http://noembed.com/, though the formatting for things like tweets & gists is a little weird.

returns

  • {Error|null} err
  • {HTMLElement|undefined} embed iframe element
  • {Object|undefined} data complete noembed.com response

License

MIT

About

embed popular media formats using noembed.com

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published