still fixing video streaming, issue with canceled request

This commit is contained in:
subnub
2020-05-11 00:20:06 -04:00
parent f6649f5c2b
commit 985ef2dfc3
5 changed files with 23 additions and 11 deletions
+7 -1
View File
@@ -132,7 +132,7 @@ class S3Service implements ChunkInterface {
}
streamVideo = async(user: UserInterface, fileID: string, headers: any, res: Response) => {
streamVideo = async(user: UserInterface, fileID: string, headers: any, res: Response, req: Request) => {
const userID = user._id;
const currentFile: FileInterface = await dbUtilsFile.getFileInfo(fileID, userID);
@@ -192,6 +192,12 @@ class S3Service implements ChunkInterface {
s3ReadStream.pipe(decipher);
req.on("close", () => {
console.log("Destoying read stream");
s3ReadStream.destroy();
console.log("Read Stream Destroyed");
})
await awaitStreamVideo(start, end, differenceStart, decipher, res, allStreamsToErrorCatch);
}