From 70e6475bbe07b8149c1a427ed97677d09958e853 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 26 Mar 2024 07:54:01 -0400 Subject: [PATCH] completeFile --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 494d1f8..bdc5d3a 100644 --- a/index.js +++ b/index.js @@ -71,7 +71,7 @@ app.get('/videos/:filename', (req, res)=>{ const end = parts[1] ? parseInt(parts[1], 10) : fileSize - 1; const chunksize = end - start + 1; - const file = fs.createReadStream(filePath, {start, end}); + const file = fs.createReadStream(completeFile, {start, end}); const head = { 'Content-Range': `bytes ${start}-${end}/${fileSize}`, 'Accept-Ranges': 'bytes', @@ -87,7 +87,7 @@ app.get('/videos/:filename', (req, res)=>{ 'Content-Type': 'video/mp4' }; res.writeHead(200, head); - fs.createReadStream(filePath).pipe(res) + fs.createReadStream(completeFile).pipe(res) } })