video-embed-swap

Vanilla Javascript function that automatically converts youtube and vimeo urls to embed code.

Usage no npm install needed!

<script type="module">
  import videoEmbedSwap from 'https://cdn.skypack.dev/video-embed-swap';
</script>

README

video-embed-swap

Vanilla Javascript function that automatically converts youtube & vimeo url to embed code.

!?WHY?!

When the backend only has a vimeo / youtube url available and you need to use that for both a modal plugin on one page, and also use it to do an embed in another instance then stick this function in your build.

Package management

Install with Bower: bower install video-embed-swap

Install with npm: npm install video-embed-swap