From c711a0fe0cabad960e3ca85bb4c08e868fee884d Mon Sep 17 00:00:00 2001 From: bluedeepart Date: Wed, 20 Nov 2024 13:01:39 +0530 Subject: [PATCH] fixed embedHref --- scripts/scripts.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/scripts.js b/scripts/scripts.js index a01b3dc2e..1a4c78dac 100644 --- a/scripts/scripts.js +++ b/scripts/scripts.js @@ -460,6 +460,8 @@ function addPageSchema() { const h1 = document.querySelector('main h1'); const schemaTitle = h1 ? h1.textContent : getMetadata('og:title'); + const vidyardLink = document.querySelector('a[href*="vidyard.com"], a[href*="vids.moleculardevices.com"]').href; + const vidyardId = vidyardLink.split('/').pop(); const heroImage = document.querySelector('.hero img'); const resourcesImage = getMetadata('thumbnail') || getMetadata('og:image') || moleculardevicesLogoURL; @@ -473,7 +475,7 @@ function addPageSchema() { const eventAddress = getMetadata('event-address'); const publicationDate = getMetadata('publication-date'); const canonicalHref = document.querySelector("link[rel='canonical']").href; - const embedHref = document.querySelector("link[rel='prefetch']").href; + const embedHref = `https://play.vidyard.com/${vidyardId}?disable_popouts=1&v=4.3.15&autoplay=1&type=lightbox`; const schema = document.createElement('script'); schema.setAttribute('type', 'application/ld+json');