- const filename = `${video.name}-${videoFile.resolution}p-${streamingPlaylist.getStringType()}${videoFile.extname}`
- return res.download(getVideoFilePath(streamingPlaylist, videoFile), filename)
+ if (videoFile.storage === VideoStorage.OBJECT_STORAGE) {
+ return res.redirect(videoFile.getObjectStorageUrl())
+ }
+
+ await VideoPathManager.Instance.makeAvailableVideoFile(videoFile.withVideoOrPlaylist(streamingPlaylist), path => {
+ const filename = `${video.name}-${videoFile.resolution}p-${streamingPlaylist.getStringType()}${videoFile.extname}`
+
+ return res.download(path, filename)
+ })