diff --git a/plugins/prebuffer-mixin/package-lock.json b/plugins/prebuffer-mixin/package-lock.json index 760ba446e..fda6f023b 100644 --- a/plugins/prebuffer-mixin/package-lock.json +++ b/plugins/prebuffer-mixin/package-lock.json @@ -1,12 +1,12 @@ { "name": "@scrypted/prebuffer-mixin", - "version": "0.1.126", + "version": "0.1.128", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@scrypted/prebuffer-mixin", - "version": "0.1.126", + "version": "0.1.128", "license": "Apache-2.0", "dependencies": { "@scrypted/common": "file:../../common", diff --git a/plugins/prebuffer-mixin/package.json b/plugins/prebuffer-mixin/package.json index 705b0436d..48bdffb86 100644 --- a/plugins/prebuffer-mixin/package.json +++ b/plugins/prebuffer-mixin/package.json @@ -1,6 +1,6 @@ { "name": "@scrypted/prebuffer-mixin", - "version": "0.1.126", + "version": "0.1.128", "description": "Rebroadcast and Prebuffer for VideoCameras.", "author": "Scrypted", "license": "Apache-2.0", diff --git a/plugins/prebuffer-mixin/src/main.ts b/plugins/prebuffer-mixin/src/main.ts index 96b5882b1..eeb4305cc 100644 --- a/plugins/prebuffer-mixin/src/main.ts +++ b/plugins/prebuffer-mixin/src/main.ts @@ -61,6 +61,7 @@ class PrebufferSession { storage: Storage; activeClients = 0; + inactivityTimeout: NodeJS.Timeout; AUDIO_CONFIGURATION = AUDIO_CONFIGURATION_TEMPLATE + '-' + this.streamId; @@ -380,7 +381,8 @@ class PrebufferSession { if (this.activeClients) return; - setTimeout(() => { + clearTimeout(this.inactivityTimeout) + this.inactivityTimeout = setTimeout(() => { if (this.activeClients) return; this.console.log(this.streamName, 'terminating rebroadcast due to inactivity');