Set correctly preview image for open graph

pull/76/head
Chocobozzz 2017-07-12 12:19:39 +02:00
parent 43f61d2635
commit d38309c345
2 changed files with 2 additions and 13 deletions

View File

@ -321,7 +321,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
this.metaService.setTag('og:description', this.video.description)
this.metaService.setTag('description', this.video.description)
this.metaService.setTag('og:image', this.video.thumbnailPath)
this.metaService.setTag('og:image', this.video.previewPath)
this.metaService.setTag('og:duration', this.video.duration.toString())

View File

@ -45,18 +45,7 @@ export {
// ---------------------------------------------------------------------------
function addOpenGraphTags (htmlStringPage: string, video: VideoInstance) {
let basePreviewUrlHttp
if (video.isOwned()) {
basePreviewUrlHttp = CONFIG.WEBSERVER.URL
} else {
basePreviewUrlHttp = REMOTE_SCHEME.HTTP + '://' + video.Author.Pod.host
}
// We fetch the remote preview (bigger than the thumbnail)
// This should not overhead the remote server since social websites put in a cache the OpenGraph tags
// We can't use the thumbnail because these social websites want bigger images (> 200x200 for Facebook for example)
const previewUrl = basePreviewUrlHttp + STATIC_PATHS.PREVIEWS + video.getPreviewName()
const previewUrl = CONFIG.WEBSERVER.URL + STATIC_PATHS.PREVIEWS + video.getPreviewName()
const videoUrl = CONFIG.WEBSERVER.URL + '/videos/watch/' + video.id
const metaTags = {