diff --git a/web/src/html.js b/web/src/html.js index 7c33f9d68..cb6e7d1e0 100644 --- a/web/src/html.js +++ b/web/src/html.js @@ -143,6 +143,9 @@ function buildClaimOgMetadata(uri, claim, overrideOptions = {}, referrerQuery) { const mediaDuration = media && media.duration; const claimTitle = escapeHtmlProperty((value && value.title) || claimName); const releaseTime = (value && value.release_time) || (meta && meta.creation_timestamp) || 0; + const liveStream = !source; + const mediaHeight = (media && media.height) || '720'; + const mediaWidth = (media && media.width) || '1280'; const claimDescription = value && value.description && value.description.length > 0 @@ -164,7 +167,8 @@ function buildClaimOgMetadata(uri, claim, overrideOptions = {}, referrerQuery) { getThumbnailCdnUrl(OG_IMAGE_URL) || `${URL}/public/v2-og.png`; - const getOgType = (streamType) => { + const getOgType = (streamType, liveStream) => { + if (liveStream) return 'video.other'; switch (streamType) { // https://ogp.me/?fbclid=IwAR0Dr3Rb3tw1W5wjFtuRMZfwewM2vlrSnNp-_ZKlvCzo5nKuX2TuTqt0kU8#types case 'video': @@ -201,7 +205,7 @@ function buildClaimOgMetadata(uri, claim, overrideOptions = {}, referrerQuery) { head += ``; head += ``; head += ``; - head += ``; + head += ``; head += ``; head += ``; head += ``; @@ -215,7 +219,7 @@ function buildClaimOgMetadata(uri, claim, overrideOptions = {}, referrerQuery) { claimPath )}&format=xml${referrerQuery ? `&r=${encodeURIComponent(referrerQuery)}` : ''}" title="${title}" />`; - if ((mediaType && (mediaType.startsWith('video/') || mediaType.startsWith('audio/'))) || !mediaType) { + if ((mediaType && (mediaType.startsWith('video/') || mediaType.startsWith('audio/'))) || liveStream) { const videoUrl = generateEmbedUrl(claim.name, claim.claim_id); head += ``; head += ``; @@ -231,14 +235,12 @@ function buildClaimOgMetadata(uri, claim, overrideOptions = {}, referrerQuery) { head += ``; } if (mediaDuration) { - head += ``; - } - if (media && media.width && media.height) { - head += ``; - head += ``; - head += ``; - head += ``; + head += ``; } + head += ``; + head += ``; + head += ``; + head += ``; } else { head += ``; }