- const thumbnailUrl = constants.CONFIG.WEBSERVER.URL + video.thumbnailPath
- const videoUrl = constants.CONFIG.WEBSERVER.URL + '/videos/watch/'
+ let basePreviewUrlHttp
+
+ if (video.isOwned()) {
+ basePreviewUrlHttp = constants.CONFIG.WEBSERVER.URL
+ } else {
+ basePreviewUrlHttp = constants.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 + constants.STATIC_PATHS.PREVIEWS + video.getPreviewName()
+ const videoUrl = constants.CONFIG.WEBSERVER.URL + '/videos/watch/' + video.id