ニジカ投稿局 https://tv.nizika.tv
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

31 lines
1003 B

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