diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-07-12 12:19:39 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-07-12 12:19:39 +0200 |
commit | d38309c345e2619bdfcc618d723d742fd7d5e655 (patch) | |
tree | 567693ee8fe9dac21f43a2b0a7b007d8dedc5450 /server/controllers | |
parent | 43f61d2635113001c3d19e3299d8700a00d47e48 (diff) | |
download | PeerTube-d38309c345e2619bdfcc618d723d742fd7d5e655.tar.gz PeerTube-d38309c345e2619bdfcc618d723d742fd7d5e655.tar.zst PeerTube-d38309c345e2619bdfcc618d723d742fd7d5e655.zip |
Set correctly preview image for open graph
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/client.ts | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/server/controllers/client.ts b/server/controllers/client.ts index d913f81b8..1324e62cd 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts | |||
@@ -45,18 +45,7 @@ export { | |||
45 | // --------------------------------------------------------------------------- | 45 | // --------------------------------------------------------------------------- |
46 | 46 | ||
47 | function addOpenGraphTags (htmlStringPage: string, video: VideoInstance) { | 47 | function addOpenGraphTags (htmlStringPage: string, video: VideoInstance) { |
48 | let basePreviewUrlHttp | 48 | const previewUrl = CONFIG.WEBSERVER.URL + STATIC_PATHS.PREVIEWS + video.getPreviewName() |
49 | |||
50 | if (video.isOwned()) { | ||
51 | basePreviewUrlHttp = CONFIG.WEBSERVER.URL | ||
52 | } else { | ||
53 | basePreviewUrlHttp = REMOTE_SCHEME.HTTP + '://' + video.Author.Pod.host | ||
54 | } | ||
55 | |||
56 | // We fetch the remote preview (bigger than the thumbnail) | ||
57 | // This should not overhead the remote server since social websites put in a cache the OpenGraph tags | ||
58 | // We can't use the thumbnail because these social websites want bigger images (> 200x200 for Facebook for example) | ||
59 | const previewUrl = basePreviewUrlHttp + STATIC_PATHS.PREVIEWS + video.getPreviewName() | ||
60 | const videoUrl = CONFIG.WEBSERVER.URL + '/videos/watch/' + video.id | 49 | const videoUrl = CONFIG.WEBSERVER.URL + '/videos/watch/' + video.id |
61 | 50 | ||
62 | const metaTags = { | 51 | const metaTags = { |