mirror of
https://github.com/koush/scrypted.git
synced 2026-02-09 00:39:56 +00:00
rebroadcast: fix inactivity grace period
This commit is contained in:
4
plugins/prebuffer-mixin/package-lock.json
generated
4
plugins/prebuffer-mixin/package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user