JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7280
  • Score
    100M100P100Q122729F
  • License MIT

Get embed code for embedding youtube/vimeo/whatever video in websites from URL or ID

Package Exports

  • embed-video

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (embed-video) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

embed-video Dependency Status

Get embed code for embedding youtube/vimeo/whatever video in websites from URL or ID.

Currently supports YouTube and Vimeo. Please pull request to add others!

Usage

var embed = require("embed-video")

var vimeoUrl = "http://vimeo.com/19339941"
var youtubeUrl = "https://www.youtube.com/watch?v=twE64AuqE9A"

console.log(embed(vimeoUrl))
console.log(embed(youtubeUrl))

var vimeoId = "6964150"
var youtubeId = "9XeNNqeHVDw"

console.log(embed.vimeo(vimeoId))
console.log(embed.youtube(youtubeId))

Output:

<iframe src="//player.vimeo.com/video/19339941" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<iframe src="//www.youtube.com/embed/twE64AuqE9A" frameborder="0" allowfullscreen></iframe>
<iframe src="//player.vimeo.com/video/6964150" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
<iframe src="//www.youtube.com/embed/9XeNNqeHVDw" frameborder="0" allowfullscreen></iframe>