aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/static.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r--server/controllers/static.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/controllers/static.ts b/server/controllers/static.ts
index 52e48267f..9baff94c0 100644
--- a/server/controllers/static.ts
+++ b/server/controllers/static.ts
@@ -90,6 +90,7 @@ export {
90 90
91async function servePrivateM3U8 (req: express.Request, res: express.Response) { 91async function servePrivateM3U8 (req: express.Request, res: express.Response) {
92 const path = join(DIRECTORIES.HLS_STREAMING_PLAYLIST.PRIVATE, req.params.videoUUID, req.params.playlistName + '.m3u8') 92 const path = join(DIRECTORIES.HLS_STREAMING_PLAYLIST.PRIVATE, req.params.videoUUID, req.params.playlistName + '.m3u8')
93 const filename = req.params.playlistName + '.m3u8'
93 94
94 let playlistContent: string 95 let playlistContent: string
95 96
@@ -108,7 +109,7 @@ async function servePrivateM3U8 (req: express.Request, res: express.Response) {
108 109
109 // Inject token in playlist so players that cannot alter the HTTP request can still watch the video 110 // Inject token in playlist so players that cannot alter the HTTP request can still watch the video
110 const transformedContent = doReinjectVideoFileToken(req) 111 const transformedContent = doReinjectVideoFileToken(req)
111 ? injectQueryToPlaylistUrls(playlistContent, buildReinjectVideoFileTokenQuery(req)) 112 ? injectQueryToPlaylistUrls(playlistContent, buildReinjectVideoFileTokenQuery(req, filename.endsWith('master.m3u8')))
112 : playlistContent 113 : playlistContent
113 114
114 return res.set('content-type', 'application/vnd.apple.mpegurl').send(transformedContent).end() 115 return res.set('content-type', 'application/vnd.apple.mpegurl').send(transformedContent).end()