mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 18:29:27 +02:00
server/server -> server/core
This commit is contained in:
parent
114327d4ce
commit
5a3d0650c9
838 changed files with 111 additions and 111 deletions
31
server/core/lib/video-urls.ts
Normal file
31
server/core/lib/video-urls.ts
Normal file
|
@ -0,0 +1,31 @@
|
|||
|
||||
import { STATIC_PATHS, WEBSERVER } from '@server/initializers/constants.js'
|
||||
import { MStreamingPlaylist, MVideo, MVideoFile, MVideoUUID } from '@server/types/models/index.js'
|
||||
|
||||
// ################## 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue