+}
+
+function addVideoFilesInAPAcc (
+ acc: ActivityUrlObject[] | ActivityTagObject[],
+ model: MVideoAP | MStreamingPlaylistVideo,
+ baseUrlHttp: string,
+ baseUrlWs: string,
+ files: MVideoFile[]
+) {
+ const sortedFiles = [ ...files ]
+ .filter(f => !f.isLive())
+ .sort(sortByResolutionDesc)
+
+ for (const file of sortedFiles) {
+ acc.push({
+ type: 'Link',
+ mediaType: MIMETYPES.VIDEO.EXT_MIMETYPE[file.extname] as any,
+ href: model.getVideoFileUrl(file, baseUrlHttp),
+ height: file.resolution,
+ size: file.size,
+ fps: file.fps
+ })
+
+ acc.push({
+ type: 'Link',
+ rel: [ 'metadata', MIMETYPES.VIDEO.EXT_MIMETYPE[file.extname] ],
+ mediaType: 'application/json' as 'application/json',
+ href: extractVideo(model).getVideoFileMetadataUrl(file, baseUrlHttp),
+ height: file.resolution,
+ fps: file.fps
+ })
+
+ acc.push({
+ type: 'Link',
+ mediaType: 'application/x-bittorrent' as 'application/x-bittorrent',
+ href: model.getTorrentUrl(file, baseUrlHttp),
+ height: file.resolution