bootstrap4.videoembed.js
Embed Youtube and/or Vimeo videos into your Bootstrap 4 site. Creates a clickable thumbnail that opens a modal containing the video. Supports autoplay.
Installation
npm install bootstrap4-videoembed
npm run build
or
yarn add bootstrap4-videoembed
yarn run build
or
Just copy distribution/bootstrap4.videoembed.min.js
and include in your site
just above the </body>
tag if you don't want to recompile from source.
Usage
Once, you have the plugin included on your page, you can define your videos like this:
[video image goes here][video image goes here]
And initialize them in Javascript like this:
document;
Demo
Run
npm run test
or
yarn run test
Why?
This could easily have been another jQuery plugin (it would have been smaller for sure), but I wanted to experiment with ES6, Babel and Webpack.
License
MIT