Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

video schema update #1544

Merged
merged 2 commits into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -473,6 +475,7 @@ function addPageSchema() {
const eventAddress = getMetadata('event-address');
const publicationDate = getMetadata('publication-date');
const canonicalHref = document.querySelector("link[rel='canonical']").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');
Expand Down Expand Up @@ -690,7 +693,7 @@ function addPageSchema() {
thumbnailUrl: resourcesImageUrl,
uploadDate: new Date(publicationDate).toISOString(),
contentUrl: canonicalHref,
embedUrl: canonicalHref,
embedUrl: embedHref,
duration: '',
publisher: {
'@type': 'Organization',
Expand Down