JAVASCRIPT   60

vimeo video js

Guest on 13th June 2022 05:03:59 PM

  1. document.addEventListener('DOMContentLoaded', () => {
  2.   let wrap = document.querySelector('.vimeo-wrap');
  3.   let vimeoId = document.querySelector('#vimeoId').innerHTML;
  4.   let iframe = '<iframe src="https://player.vimeo.com/video/' + vimeoId + '?autoplay=1&loop=1&muted=1&controls=0" class="vimeo" frameborder="0" allow="autoplay; fullscreen; picture-in-picture" allowfullscreen></iframe>';
  5.  
  6.   wrap.innerHTML = iframe;
  7. });

Raw Paste


Login or Register to edit or fork this paste. It's free.