blob: 0597488ad4ad684a15bea5d5d87a9a0a18499b0f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
import { STATIC_PATHS, WEBSERVER } from '@server/initializers/constants'
import { MStreamingPlaylist, MVideo, MVideoFile, MVideoUUID } from '@server/types/models'
// ################## Redundancy ##################
function generateHLSRedundancyUrl (video: MVideo, playlist: MStreamingPlaylist) {
// Base URL used by our HLS player
return WEBSERVER.URL + STATIC_PATHS.REDUNDANCY + playlist.getStringType() + '/' + video.uuid
}
function generateWebVideoRedundancyUrl (file: MVideoFile) {
return WEBSERVER.URL + STATIC_PATHS.REDUNDANCY + file.filename
}
// ################## Meta data ##################
function getLocalVideoFileMetadataUrl (video: MVideoUUID, videoFile: MVideoFile) {
const path = '/api/v1/videos/'
return WEBSERVER.URL + path + video.uuid + '/metadata/' + videoFile.id
}
// ---------------------------------------------------------------------------
export {
getLocalVideoFileMetadataUrl,
generateWebVideoRedundancyUrl,
generateHLSRedundancyUrl
}
|