changed twitter:player:width and height

This commit is contained in:
bill bittner 2017-08-08 11:32:19 -07:00
parent b36c9d7681
commit 4ceda92291

View file

@ -49,54 +49,54 @@ const hbs = expressHandlebars.create({
);
},
addOpenGraph (title, mimeType, showUrl, source) {
let basicTags = `<meta property="og:title" content="${title}"/>
<meta property="og:url" content="${showUrl}" />
<meta property="og:site_name" content="Spee.ch" />
<meta property="og:description" content="View or download ${title} from spee.ch: the open-source, decentralized content host." />`;
let basicTags = `<meta property="og:title" content="${title}">
<meta property="og:url" content="${showUrl}" >
<meta property="og:site_name" content="Spee.ch" >
<meta property="og:description" content="View or download ${title} from spee.ch: the open-source, decentralized content host." >`;
if (mimeType === 'video/mp4') {
return new Handlebars.SafeString(
`${basicTags} <meta property="og:image" content="https://spee.ch/assets/img/content-freedom-large.png" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="600" />
<meta property="og:image:height" content="315" />
<meta property="og:type" content="video" />
<meta property="og:video" content="${source}" />
<meta property="og:video:secure_url" content="${source}" />
<meta property="og:video:type" content="${mimeType}" />`
`${basicTags} <meta property="og:image" content="https://spee.ch/assets/img/content-freedom-large.png" >
<meta property="og:image:type" content="image/png" >
<meta property="og:image:width" content="600" >
<meta property="og:image:height" content="315" >
<meta property="og:type" content="video" >
<meta property="og:video" content="${source}" >
<meta property="og:video:secure_url" content="${source}" >
<meta property="og:video:type" content="${mimeType}" >`
);
} else if (mimeType === 'image/gif') {
return new Handlebars.SafeString(
`${basicTags} <meta property="og:image" content="${source}" />
<meta property="og:image:type" content="${mimeType}" />
<meta property="og:image:width" content="600" />
<meta property="og:image:height" content="315" />
<meta property="og:type" content="video.other" />`
`${basicTags} <meta property="og:image" content="${source}" >
<meta property="og:image:type" content="${mimeType}" >
<meta property="og:image:width" content="600" >
<meta property="og:image:height" content="315" >
<meta property="og:type" content="video.other" >`
);
} else {
return new Handlebars.SafeString(
`${basicTags} <meta property="og:image" content="${source}" />
<meta property="og:image:type" content="${mimeType}" />
<meta property="og:image:width" content="600" />
<meta property="og:image:height" content="315" />
<meta property="og:type" content="article" />`
`${basicTags} <meta property="og:image" content="${source}" >
<meta property="og:image:type" content="${mimeType}" >
<meta property="og:image:width" content="600" >
<meta property="og:image:height" content="315" >
<meta property="og:type" content="article" >`
);
}
},
addTwitterCard (mimeType, source, embedUrl, directFileUrl) {
let basicTwitterTags = `<meta name="twitter:site" content="@lbryio" />`;
let basicTwitterTags = `<meta name="twitter:site" content="@speechch" >`;
if (mimeType === 'video/mp4') {
return new Handlebars.SafeString(
`${basicTwitterTags} <meta name="twitter:card" content="player" />
`${basicTwitterTags} <meta name="twitter:card" content="player" >
<meta name="twitter:player" content="${embedUrl}>
<meta name="twitter:player:width" content="480" />
<meta name="twitter:player:height" content="480" />
<meta name="twitter:player:stream" content="${directFileUrl}" />
<meta name="twitter:player:stream:content_type" content="video/mp4" />
<meta name="twitter:player:width" content="600" >
<meta name="twitter:player:height" content="315" >
<meta name="twitter:player:stream" content="${directFileUrl}" >
<meta name="twitter:player:stream:content_type" content="video/mp4" >
`
);
} else {
return new Handlebars.SafeString(
`${basicTwitterTags} <meta name="twitter:card" content="summary_large_image" />`
`${basicTwitterTags} <meta name="twitter:card" content="summary_large_image" >`
);
}
},