diff options
author | Chocobozzz <me@florianbigard.com> | 2020-02-04 09:19:56 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-02-04 09:19:56 +0100 |
commit | 22f18a4a197513c4cae685717829637cae853ae2 (patch) | |
tree | 12a050c75b38c5db9807f1aa3de7083aef540420 /server | |
parent | 9c9a16678354f737144ce2156ce0b7e4faa97eac (diff) | |
download | PeerTube-22f18a4a197513c4cae685717829637cae853ae2.tar.gz PeerTube-22f18a4a197513c4cae685717829637cae853ae2.tar.zst PeerTube-22f18a4a197513c4cae685717829637cae853ae2.zip |
Fix embed on mastodon
Diffstat (limited to 'server')
-rw-r--r-- | server/models/video/video-format-utils.ts | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/server/models/video/video-format-utils.ts b/server/models/video/video-format-utils.ts index 2aa5b8677..67395e5c0 100644 --- a/server/models/video/video-format-utils.ts +++ b/server/models/video/video-format-utils.ts | |||
@@ -270,7 +270,15 @@ function videoModelToActivityPubObject (video: MVideoAP): VideoTorrentObject { | |||
270 | } | 270 | } |
271 | } | 271 | } |
272 | 272 | ||
273 | const url: ActivityUrlObject[] = [] | 273 | const url: ActivityUrlObject[] = [ |
274 | // HTML url should be the first element in the array so Mastodon correctly displays the embed | ||
275 | { | ||
276 | type: 'Link', | ||
277 | mediaType: 'text/html', | ||
278 | href: WEBSERVER.URL + '/videos/watch/' + video.uuid | ||
279 | } | ||
280 | ] | ||
281 | |||
274 | addVideoFilesInAPAcc(url, video, baseUrlHttp, baseUrlWs, video.VideoFiles || []) | 282 | addVideoFilesInAPAcc(url, video, baseUrlHttp, baseUrlWs, video.VideoFiles || []) |
275 | 283 | ||
276 | for (const playlist of (video.VideoStreamingPlaylists || [])) { | 284 | for (const playlist of (video.VideoStreamingPlaylists || [])) { |
@@ -296,13 +304,6 @@ function videoModelToActivityPubObject (video: MVideoAP): VideoTorrentObject { | |||
296 | }) | 304 | }) |
297 | } | 305 | } |
298 | 306 | ||
299 | // Add video url too | ||
300 | url.push({ | ||
301 | type: 'Link', | ||
302 | mediaType: 'text/html', | ||
303 | href: WEBSERVER.URL + '/videos/watch/' + video.uuid | ||
304 | }) | ||
305 | |||
306 | const subtitleLanguage = [] | 307 | const subtitleLanguage = [] |
307 | for (const caption of video.VideoCaptions) { | 308 | for (const caption of video.VideoCaptions) { |
308 | subtitleLanguage.push({ | 309 | subtitleLanguage.push({ |