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) {
|
addTwitterCard (source, mimeType) {
|
||||||
if (assetType === 'image') {
|
if (mimeType === 'video/mp4') {
|
||||||
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') {
|
|
||||||
return new Handlebars.SafeString(
|
return new Handlebars.SafeString(
|
||||||
`<meta name="twitter:card" content="player" />
|
`<meta name="twitter:card" content="player" />
|
||||||
<meta name="twitter:site" content="@lbryio" />
|
<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"" />
|
<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) {
|
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/generalStyle.css" type="text/css">
|
||||||
<link rel="stylesheet" href="/assets/css/componentStyle.css" type="text/css">
|
<link rel="stylesheet" href="/assets/css/componentStyle.css" type="text/css">
|
||||||
<meta property="fb:app_id" content="1371961932852223">
|
<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 }}}
|
{{{addOpenGraph fileInfo.name openGraphInfo.showUrl openGraphInfo.source fileInfo.fileType }}}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
|
@ -6,8 +6,10 @@
|
||||||
{{!--fallback--}}
|
{{!--fallback--}}
|
||||||
Your browser does not support the <code>video</code> element.
|
Your browser does not support the <code>video</code> element.
|
||||||
</video>
|
</video>
|
||||||
|
|
||||||
{{else}}
|
{{else}}
|
||||||
<img class="show-asset-lite" src="/media/{{fileInfo.fileName}}" alt="{
|
<img class="show-asset-lite" src="/media/{{fileInfo.fileName}}" alt="{{fileInfo.fileName}}"/>
|
||||||
|
|
||||||
{{/ifConditional}}
|
{{/ifConditional}}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
Loading…
Add table
Reference in a new issue