This module generates video embed code for services like YouTube, Vimeo and Vevo. In short, it converts this:
https://www.youtube.com/watch?v=oHg5SJYRHA0
To this:
<iframe src="//www.youtube.com/embed/oHg5SJYRHA0" frameborder="0" allowfullscreen></iframe>
var videoEmbed = require('video-embed');
var embedHTML = videoEmbed('https://www.youtube.com/watch?v=oHg5SJYRHA0');
console.log(embedHTML);
// <iframe src="//www.youtube.com/embed/oHg5SJYRHA0" frameborder="0" allowfullscreen></iframe>
The module currently supports the following video websites:
The module supports the following YouTube link formats
The module supports the following Vimeo link formats
The module supports the following Vevo link formats
- http://www.vevo.com/watch/striking-matches/Hanging-On-A-Lie/USUV71500275
- http://www.vevo.com/watch/american-fangs/Man-in-the-Sun-(Official-Video)/USV291470452?syndicationid=bb8a16ab-1279-4f17-969b-1dba5eb60eda&shortlink=nv0hFi&country=GB
If you'd like other video websites to be supported you are more than welcome to submit a pull request or an issue requesting a site 😃