fixed issue with show lite and removed assettype from twitter

This commit is contained in:
bill bittner 2017-08-07 13:57:50 -07:00
parent 9015c186c9
commit 35cf994149
3 changed files with 12 additions and 11 deletions

View file

@ -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=&quot;avc1.42E01E1, mp4a.40.2&quot;" />
`
);
} 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) {

View file

@ -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>

View file

@ -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>