2 import { STATIC_PATHS, WEBSERVER } from '@server/initializers/constants'
3 import { MStreamingPlaylist, MVideo, MVideoFile, MVideoUUID } from '@server/types/models'
5 // ################## Redundancy ##################
7 function generateHLSRedundancyUrl (video: MVideo, playlist: MStreamingPlaylist) {
8 // Base URL used by our HLS player
9 return WEBSERVER.URL + STATIC_PATHS.REDUNDANCY + playlist.getStringType() + '/' + video.uuid
12 function generateWebTorrentRedundancyUrl (file: MVideoFile) {
13 return WEBSERVER.URL + STATIC_PATHS.REDUNDANCY + file.filename
16 // ################## Meta data ##################
18 function getLocalVideoFileMetadataUrl (video: MVideoUUID, videoFile: MVideoFile) {
19 const path = '/api/v1/videos/'
21 return WEBSERVER.URL + path + video.uuid + '/metadata/' + videoFile.id
24 // ---------------------------------------------------------------------------
27 getLocalVideoFileMetadataUrl,
29 generateWebTorrentRedundancyUrl,
30 generateHLSRedundancyUrl