Open graph #132
3 changed files with 12 additions and 11 deletions
17
speech.js
17
speech.js
|
@ -90,15 +90,8 @@ const hbs = expressHandlebars.create({
|
|||
);
|
||||
}
|
||||
},
|
||||
addTwitterCard (assetType, source) {
|
||||
if (assetType === 'image') {
|
||||
return new Handlebars.SafeString(
|
||||
`<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:site" content="@lbryio" />
|
||||
<meta name="twitter:creator" content="@lbryio" />
|
||||
`
|
||||
);
|
||||
} else if (assetType === 'video') {
|
||||
addTwitterCard (source, mimeType) {
|
||||
if (mimeType === 'video/mp4') {
|
||||
return new Handlebars.SafeString(
|
||||
`<meta name="twitter:card" content="player" />
|
||||
<meta name="twitter:site" content="@lbryio" />
|
||||
|
@ -110,6 +103,12 @@ const hbs = expressHandlebars.create({
|
|||
<meta name="twitter:player:stream:content_type" content="video/mp4; codecs="avc1.42E01E1, mp4a.40.2"" />
|
||||
`
|
||||
);
|
||||
} else {
|
||||
return new Handlebars.SafeString(
|
||||
`<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:site" content="@lbryio" />
|
||||
<meta name="twitter:creator" content="@lbryio" />`
|
||||
);
|
||||
}
|
||||
},
|
||||
ifConditional (varOne, operator, varTwo, options) {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<link rel="stylesheet" href="/assets/css/generalStyle.css" type="text/css">
|
||||
<link rel="stylesheet" href="/assets/css/componentStyle.css" type="text/css">
|
||||
<meta property="fb:app_id" content="1371961932852223">
|
||||
{{{addTwitterCard openGraphInfo.type openGraphInfo.source}}}
|
||||
{{{addTwitterCard openGraphInfo.source fileInfo.fileType}}}
|
||||
{{{addOpenGraph fileInfo.name openGraphInfo.showUrl openGraphInfo.source fileInfo.fileType }}}
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -6,8 +6,10 @@
|
|||
{{!--fallback--}}
|
||||
Your browser does not support the <code>video</code> element.
|
||||
</video>
|
||||
|
||||
{{else}}
|
||||
<img class="show-asset-lite" src="/media/{{fileInfo.fileName}}" alt="{
|
||||
<img class="show-asset-lite" src="/media/{{fileInfo.fileName}}" alt="{{fileInfo.fileName}}"/>
|
||||
|
||||
{{/ifConditional}}
|
||||
</a>
|
||||
</div>
|
Loading…
Reference in a new issue