From 37fdd8b4695df46d983d4e88523170ccc5c496c5 Mon Sep 17 00:00:00 2001 From: Pardeep Gera Date: Thu, 9 Nov 2023 12:28:48 +0530 Subject: [PATCH] Added block for vimeo player --- blocks/vimeo/vimeo.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 blocks/vimeo/vimeo.js diff --git a/blocks/vimeo/vimeo.js b/blocks/vimeo/vimeo.js new file mode 100644 index 00000000..3b6ccf9b --- /dev/null +++ b/blocks/vimeo/vimeo.js @@ -0,0 +1,12 @@ +export default function decorate(block) { + const anchorLink = block.querySelector('a'); + const ifrm = document.createElement('iframe'); + ifrm.setAttribute('src', anchorLink); + ifrm.style.width = '800px'; + ifrm.style.height = '600px'; + ifrm.style.frameBorder = '0'; + ifrm.style.allow = 'autoplay; fullscreen; picture-in-picture'; + ifrm.setAttribute('allowFullScreen', ''); + block.innerHTML = ''; + block.append(ifrm); +}