completeFile
This commit is contained in:
@@ -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)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user