diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-11-18 18:55:34 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-11-18 18:55:34 +0100 |
commit | 40e3f5e1c5203266d9fb078076c8c4dc61b24be8 (patch) | |
tree | 0a6214cf608df5d1b7c09e2f2b2745322afdadba /server | |
parent | 4c1068fceec5e855e5e22d27cfbda5026c5d6374 (diff) | |
download | PeerTube-40e3f5e1c5203266d9fb078076c8c4dc61b24be8.tar.gz PeerTube-40e3f5e1c5203266d9fb078076c8c4dc61b24be8.tar.zst PeerTube-40e3f5e1c5203266d9fb078076c8c4dc61b24be8.zip |
Fix opengraph url tag
Diffstat (limited to 'server')
-rw-r--r-- | server/controllers/client.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/controllers/client.js b/server/controllers/client.js index e3251d7e9..61e094980 100644 --- a/server/controllers/client.js +++ b/server/controllers/client.js | |||
@@ -31,19 +31,19 @@ module.exports = router | |||
31 | // --------------------------------------------------------------------------- | 31 | // --------------------------------------------------------------------------- |
32 | 32 | ||
33 | function addOpenGraphTags (htmlStringPage, video) { | 33 | function addOpenGraphTags (htmlStringPage, video) { |
34 | const videoUrl = constants.CONFIG.WEBSERVER.URL + '/videos/watch/' | 34 | let basePreviewUrlHttp |
35 | let baseUrlHttp | ||
36 | 35 | ||
37 | if (video.isOwned()) { | 36 | if (video.isOwned()) { |
38 | baseUrlHttp = constants.CONFIG.WEBSERVER.URL | 37 | basePreviewUrlHttp = constants.CONFIG.WEBSERVER.URL |
39 | } else { | 38 | } else { |
40 | baseUrlHttp = constants.REMOTE_SCHEME.HTTP + '://' + video.podHost | 39 | basePreviewUrlHttp = constants.REMOTE_SCHEME.HTTP + '://' + video.podHost |
41 | } | 40 | } |
42 | 41 | ||
43 | // We fetch the remote preview (bigger than the thumbnail) | 42 | // We fetch the remote preview (bigger than the thumbnail) |
44 | // This should not overhead the remote server since social websites put in a cache the OpenGraph tags | 43 | // This should not overhead the remote server since social websites put in a cache the OpenGraph tags |
45 | // We can't use the thumbnail because these social websites want bigger images (> 200x200 for Facebook for example) | 44 | // We can't use the thumbnail because these social websites want bigger images (> 200x200 for Facebook for example) |
46 | const previewUrl = baseUrlHttp + constants.STATIC_PATHS.PREVIEWS + video.getPreviewName() | 45 | const previewUrl = basePreviewUrlHttp + constants.STATIC_PATHS.PREVIEWS + video.getPreviewName() |
46 | const videoUrl = constants.CONFIG.WEBSERVER.URL + '/videos/watch/' + video._id | ||
47 | 47 | ||
48 | const metaTags = { | 48 | const metaTags = { |
49 | 'og:type': 'video', | 49 | 'og:type': 'video', |