From a1b9431b33795173ffc45aed9e3e25ed004895ed Mon Sep 17 00:00:00 2001 From: computer Date: Thu, 25 Jan 2024 19:35:49 +0100 Subject: [PATCH] set to run the application --- Backend/.env-openvidu | 2 +- Backend/src/cameraStream/cameraStream.gateway.ts | 6 +++--- Backend/src/database/database.service.ts | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Backend/.env-openvidu b/Backend/.env-openvidu index b78fe81..52fb6e3 100644 --- a/Backend/.env-openvidu +++ b/Backend/.env-openvidu @@ -1,5 +1,5 @@ OPENVIDU_SECRET=MY_SECRET OPENVIDU_WEBHOOK=true -OPENVIDU_WEBHOOK_ENDPOINT=https://backend:8080/media-server +OPENVIDU_WEBHOOK_ENDPOINT=https://localhost:8080/media-server diff --git a/Backend/src/cameraStream/cameraStream.gateway.ts b/Backend/src/cameraStream/cameraStream.gateway.ts index c549446..dd20d06 100644 --- a/Backend/src/cameraStream/cameraStream.gateway.ts +++ b/Backend/src/cameraStream/cameraStream.gateway.ts @@ -58,14 +58,14 @@ export class CameraStreamGateway implements OnGatewayConnection { try { const session = await this.openvidu.instance.createSession({}); this.sessionId = session.sessionId; - + const nvr = await this.database.getNVRData(); nvr.channels.forEach((id: number) => { const connectionProperties: ConnectionProperties = { type: ConnectionType.IPCAM, rtspUri: `${nvr.ip}/ch${id}_0.264`, - adaptativeBitrate: true, - onlyPlayWithSubscribers: true, + adaptativeBitrate: true, + onlyPlayWithSubscribers: false, networkCache: 1000, data: id.toString(), }; diff --git a/Backend/src/database/database.service.ts b/Backend/src/database/database.service.ts index 2b6e09f..ad7f68c 100644 --- a/Backend/src/database/database.service.ts +++ b/Backend/src/database/database.service.ts @@ -233,8 +233,9 @@ export class DatabaseService { channels: cameraIds, }, ); + return { - ip: array[0].ip, + ip: process.env.NVR_IP_ADDRESS, channels: array[0].channels, };