aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-10 12:26:47 +0200
committerChocobozzz <me@florianbigard.com>2018-05-11 08:48:20 +0200
commit8be1afa12b700b93ed92365cab05c0ef81d643aa (patch)
tree563369bded16d3612a631bb1a9b068b2bb76abe8 /server/controllers
parentc7b0dacb28e3b5aa9f43a7a0eb683e2af9826cb9 (diff)
downloadPeerTube-8be1afa12b700b93ed92365cab05c0ef81d643aa.tar.gz
PeerTube-8be1afa12b700b93ed92365cab05c0ef81d643aa.tar.zst
PeerTube-8be1afa12b700b93ed92365cab05c0ef81d643aa.zip
Add ability to embed a video in Twitter
The instance should be whitelisted first
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/config.ts6
-rw-r--r--server/controllers/client.ts4
2 files changed, 8 insertions, 2 deletions
diff --git a/server/controllers/api/config.ts b/server/controllers/api/config.ts
index e47b71f44..12074a80e 100644
--- a/server/controllers/api/config.ts
+++ b/server/controllers/api/config.ts
@@ -161,6 +161,12 @@ function customConfig (): CustomConfig {
161 javascript: CONFIG.INSTANCE.CUSTOMIZATIONS.JAVASCRIPT 161 javascript: CONFIG.INSTANCE.CUSTOMIZATIONS.JAVASCRIPT
162 } 162 }
163 }, 163 },
164 services: {
165 twitter: {
166 username: CONFIG.SERVICES.TWITTER.USERNAME,
167 whitelisted: CONFIG.SERVICES.TWITTER.WHITELISTED
168 }
169 },
164 cache: { 170 cache: {
165 previews: { 171 previews: {
166 size: CONFIG.CACHE.PREVIEWS.SIZE 172 size: CONFIG.CACHE.PREVIEWS.SIZE
diff --git a/server/controllers/client.ts b/server/controllers/client.ts
index b5dc7b7ed..20f7e5c9c 100644
--- a/server/controllers/client.ts
+++ b/server/controllers/client.ts
@@ -77,8 +77,8 @@ function addOpenGraphAndOEmbedTags (htmlStringPage: string, video: VideoModel) {
77 'description': videoDescriptionEscaped, 77 'description': videoDescriptionEscaped,
78 'image': previewUrl, 78 'image': previewUrl,
79 79
80 'twitter:card': 'summary_large_image', 80 'twitter:card': CONFIG.SERVICES.TWITTER.WHITELISTED ? 'player' : 'summary_large_image',
81 'twitter:site': '@Chocobozzz', 81 'twitter:site': CONFIG.SERVICES.TWITTER.USERNAME,
82 'twitter:title': videoNameEscaped, 82 'twitter:title': videoNameEscaped,
83 'twitter:description': videoDescriptionEscaped, 83 'twitter:description': videoDescriptionEscaped,
84 'twitter:image': previewUrl, 84 'twitter:image': previewUrl,