diff --git a/blocks/video/video.js b/blocks/video/video.js index 6fb36f48..da7fbe3b 100644 --- a/blocks/video/video.js +++ b/blocks/video/video.js @@ -59,13 +59,13 @@ function getVideoElement(source, autoplay, background) { video.addEventListener('loadedmetadata', () => delete video.dataset.loading); if (autoplay) video.setAttribute('autoplay', ''); if (background) { - video.setAttribute('loop', ''); - video.setAttribute('playsinline', ''); - video.removeAttribute('controls'); - video.addEventListener('canplay', () => { - video.muted = true; - video.play(); - }); + video.setAttribute('loop', ''); + video.setAttribute('playsinline', ''); + video.removeAttribute('controls'); + video.addEventListener('canplay', () => { + video.muted = true; + video.play(); + }); } const sourceEl = document.createElement('source'); @@ -76,7 +76,6 @@ function getVideoElement(source, autoplay, background) { return video; } - const loadVideoEmbed = (block, link, autoplay, background) => { if (block.dataset.embedIsLoaded === 'true') { return;