From 925d24c3a75d32185c3d4e5204933d8dc630a6ac Mon Sep 17 00:00:00 2001 From: killer069 <65385476+killer069@users.noreply.github.com> Date: Mon, 13 Sep 2021 12:48:52 +0530 Subject: [PATCH] Timer issues fixed - 0.9.9 --- play-dl/YouTube/classes/LiveStream.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/play-dl/YouTube/classes/LiveStream.ts b/play-dl/YouTube/classes/LiveStream.ts index 4b8ffe2..003ff4c 100644 --- a/play-dl/YouTube/classes/LiveStream.ts +++ b/play-dl/YouTube/classes/LiveStream.ts @@ -117,7 +117,7 @@ export class Stream { private per_sec_bytes : number; private content_length : number; private video_url : string; - private timer : NodeJS.Timer; + private timer : NodeJS.Timer | null; private cookie : string; private data_ended : boolean; private playing_count : number; @@ -162,9 +162,10 @@ export class Stream { } private cleanup(){ - clearInterval(this.timer) + clearInterval(this.timer as NodeJS.Timer) this.request?.unpipe(this.stream) this.request?.destroy() + this.timer = null this.request = null this.url = '' }