]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/feeds.ts
miniature duration visibility and overlay background opacity
[github/Chocobozzz/PeerTube.git] / server / controllers / feeds.ts
index 468f7a668dc1a43fe75b72fff956bdc072b31a93..6b64ff22720be688d1132b604bab92a71a168ad8 100644 (file)
@@ -118,6 +118,17 @@ async function generateVideoFeed (req: express.Request, res: express.Response) {
       url: videoFile.torrentUrl,
       size_in_bytes: videoFile.size
     }))
+    const videos = formattedVideoFiles.map(videoFile => (Object.assign({
+      type: 'video/mp4',
+      medium: 'video',
+      height: videoFile.resolution.label.replace('p', ''),
+      fileSize: videoFile.size,
+      url: videoFile.fileUrl,
+      framerate: videoFile.fps,
+      duration: video.duration
+    }, video.language ? {
+      lang: video.language
+    } : {})))
 
     feed.addItem({
       title: video.name,
@@ -132,9 +143,25 @@ async function generateVideoFeed (req: express.Request, res: express.Response) {
         }
       ],
       date: video.publishedAt,
-      language: video.language,
       nsfw: video.nsfw,
       torrent: torrents,
+      videos,
+      embed: {
+        url: video.getEmbedStaticPath(),
+        allowFullscreen: true
+      },
+      player: {
+        url: video.getWatchStaticPath()
+      },
+      categories: [video.category ? {
+        value: video.category,
+        label: VideoModel.getCategoryLabel(video.category)
+      } : null].filter(Boolean),
+      community: {
+        statistics: {
+          views: video.views
+        }
+      },
       thumbnail: [
         {
           url: WEBSERVER.URL + video.getMiniatureStaticPath(),