fix og metadata for videos

This commit is contained in:
Jeremy Kauffman 2019-10-07 08:05:20 -04:00 committed by Sean Yesmunt
parent af6af84a2a
commit 6a58cd0265

View file

@ -1,5 +1,5 @@
const { parseURI } = require('lbry-redux');
// const { generateStreamUrl } = require('../../src/ui/util/lbrytv');
const { generateStreamUrl } = require('../../src/ui/util/lbrytv');
const { WEB_SERVER_PORT, DOMAIN } = require('../../config');
const { readFileSync } = require('fs');
const express = require('express');
@ -111,14 +111,14 @@ app.get('*', async (req, res) => {
head += `<meta property="og:url" content="${DOMAIN}/${claim.name}:${claim.claim_id}"/>`;
if (claim.source_media_type && claim.source_media_type.startsWith('video/')) {
// const videoUrl = generateStreamUrl(claim.name, claim.claim_id);
// head += `<meta property="og:video" content="${videoUrl}" />`;
// head += `<meta property="og:video:secure_url" content="${videoUrl}" />`;
// head += `<meta property="og:video:type" content="${claim.source_media_type}" />`;
// if (claim.frame_width && claim.frame_height) {
// head += `<meta property="og:video:width" content="${claim.frame_width}/>`;
// head += `<meta property="og:video:height" content="${claim.frame_height}/>`;
// }
const videoUrl = generateStreamUrl(claim.name, claim.claim_id);
head += `<meta property="og:video" content="${videoUrl}" />`;
head += `<meta property="og:video:secure_url" content="${videoUrl}" />`;
head += `<meta property="og:video:type" content="${claim.source_media_type}" />`;
if (claim.frame_width && claim.frame_height) {
head += `<meta property="og:video:width" content="${claim.frame_width}"/>`;
head += `<meta property="og:video:height" content="${claim.frame_height}"/>`;
}
}
html = insertToHead(html, head);