From 7ff7802aa0ee6dd4c90f3e1cef1993170e7807f2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 26 Oct 2017 15:16:05 +0200 Subject: Add og:video tags --- server/controllers/client.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'server/controllers/client.ts') diff --git a/server/controllers/client.ts b/server/controllers/client.ts index 1391993a7..2071b5f01 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts @@ -8,7 +8,8 @@ import { CONFIG, STATIC_PATHS, STATIC_MAX_AGE, - OPENGRAPH_AND_OEMBED_COMMENT + OPENGRAPH_AND_OEMBED_COMMENT, + EMBED_SIZE } from '../initializers' import { root, readFileBufferPromise, escapeHTML } from '../helpers' import { asyncMiddleware } from '../middlewares' @@ -52,6 +53,7 @@ function addOpenGraphAndOEmbedTags (htmlStringPage: string, video: VideoInstance const videoName = escapeHTML(video.name) const videoDescription = escapeHTML(video.description) + const embedUrl = CONFIG.WEBSERVER.URL + video.getEmbedPath() const openGraphMetaTags = { 'og:type': 'video', @@ -60,6 +62,12 @@ function addOpenGraphAndOEmbedTags (htmlStringPage: string, video: VideoInstance 'og:url': videoUrl, 'og:description': videoDescription, + 'og:video:url': embedUrl, + 'og:video:secure_url': embedUrl, + 'og:video:type': 'text/html', + 'og:video:width': EMBED_SIZE.width, + 'og:video:height': EMBED_SIZE.height, + 'name': videoName, 'description': videoDescription, 'image': previewUrl, @@ -68,7 +76,10 @@ function addOpenGraphAndOEmbedTags (htmlStringPage: string, video: VideoInstance 'twitter:site': '@Chocobozzz', 'twitter:title': videoName, 'twitter:description': videoDescription, - 'twitter:image': previewUrl + 'twitter:image': previewUrl, + 'twitter:player': embedUrl, + 'twitter:player:width': EMBED_SIZE.width, + 'twitter:player:height': EMBED_SIZE.height } const oembedLinkTags = [ -- cgit v1.2.3