aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-07-12 12:19:39 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-07-12 12:19:39 +0200
commitd38309c345e2619bdfcc618d723d742fd7d5e655 (patch)
tree567693ee8fe9dac21f43a2b0a7b007d8dedc5450
parent43f61d2635113001c3d19e3299d8700a00d47e48 (diff)
downloadPeerTube-d38309c345e2619bdfcc618d723d742fd7d5e655.tar.gz
PeerTube-d38309c345e2619bdfcc618d723d742fd7d5e655.tar.zst
PeerTube-d38309c345e2619bdfcc618d723d742fd7d5e655.zip
Set correctly preview image for open graph
-rw-r--r--client/src/app/videos/video-watch/video-watch.component.ts2
-rw-r--r--server/controllers/client.ts13
2 files changed, 2 insertions, 13 deletions
diff --git a/client/src/app/videos/video-watch/video-watch.component.ts b/client/src/app/videos/video-watch/video-watch.component.ts
index 104ba0db6..05a2c296c 100644
--- a/client/src/app/videos/video-watch/video-watch.component.ts
+++ b/client/src/app/videos/video-watch/video-watch.component.ts
@@ -321,7 +321,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
321 this.metaService.setTag('og:description', this.video.description) 321 this.metaService.setTag('og:description', this.video.description)
322 this.metaService.setTag('description', this.video.description) 322 this.metaService.setTag('description', this.video.description)
323 323
324 this.metaService.setTag('og:image', this.video.thumbnailPath) 324 this.metaService.setTag('og:image', this.video.previewPath)
325 325
326 this.metaService.setTag('og:duration', this.video.duration.toString()) 326 this.metaService.setTag('og:duration', this.video.duration.toString())
327 327
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
47function addOpenGraphTags (htmlStringPage: string, video: VideoInstance) { 47function 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 = {