From 290926dc81e7c3e1e7252eb88dd00e886998f286 Mon Sep 17 00:00:00 2001 From: computer Date: Sun, 21 Jan 2024 22:34:23 +0100 Subject: [PATCH 1/7] Fixed large screen resize and removed unwanted pages --- Backend/.env-openvidu | 2 +- Backend/src/app/login.controller.ts | 6 ++--- Backend/src/cameraStream/cameraData.ts | 4 +++ .../src/cameraStream/cameraStream.gateway.ts | 2 +- .../video-recording-screen/video-player.tsx | 9 +++---- .../src/containers/video-stream-container.tsx | 25 ++++++++++++++++--- Frontend/src/data/camera-data.tsx | 12 +++++++++ Frontend/src/data/navbar-data.tsx | 24 +++++++++--------- Frontend/src/hooks/use-camera-slice.ts | 4 +-- Frontend/src/store/slices/camera-slice.ts | 7 ++++-- 10 files changed, 66 insertions(+), 29 deletions(-) diff --git a/Backend/.env-openvidu b/Backend/.env-openvidu index 52fb6e3..93bf591 100644 --- a/Backend/.env-openvidu +++ b/Backend/.env-openvidu @@ -1,5 +1,5 @@ OPENVIDU_SECRET=MY_SECRET OPENVIDU_WEBHOOK=true -OPENVIDU_WEBHOOK_ENDPOINT=https://localhost:8080/media-server +OPENVIDU_WEBHOOK_ENDPOINT=https://192.168.129.175:8080/media-server diff --git a/Backend/src/app/login.controller.ts b/Backend/src/app/login.controller.ts index 7cf7940..a01077c 100644 --- a/Backend/src/app/login.controller.ts +++ b/Backend/src/app/login.controller.ts @@ -24,13 +24,13 @@ export class LoginController { examples: { a: { summary: 'Existing user', - value: { + value: { name: process.env.CSD_USER, password: process.env.CSD_PASSWORD, }, }, - b: { - summary: 'Non existing user', + b: { + summary: 'Non existing user', value: { name: 'non', password: 'Basic' }, }, }, diff --git a/Backend/src/cameraStream/cameraData.ts b/Backend/src/cameraStream/cameraData.ts index b6ca116..26dc72f 100644 --- a/Backend/src/cameraStream/cameraData.ts +++ b/Backend/src/cameraStream/cameraData.ts @@ -2,6 +2,8 @@ export type Camera = { id: string; name: string; rtspUrl: string; + ip: string; + port: string; }; export const cameraData: Camera[] = [ @@ -9,6 +11,8 @@ export const cameraData: Camera[] = [ id: '1', name: 'Mainroad', rtspUrl: 'rtsp://192.168.129.244:554', + ip: '192.168.129.244', + port: '554', }, /* { id: 2, diff --git a/Backend/src/cameraStream/cameraStream.gateway.ts b/Backend/src/cameraStream/cameraStream.gateway.ts index e8d0a6c..ee430c5 100644 --- a/Backend/src/cameraStream/cameraStream.gateway.ts +++ b/Backend/src/cameraStream/cameraStream.gateway.ts @@ -62,7 +62,7 @@ export class CameraStreamGateway implements OnGatewayConnection { type: ConnectionType.IPCAM, rtspUri: camera.rtspUrl, adaptativeBitrate: true, - onlyPlayWithSubscribers: false, + onlyPlayWithSubscribers: true, networkCache: 1000, data: camera.id, }; diff --git a/Frontend/src/components/video-recording-screen/video-player.tsx b/Frontend/src/components/video-recording-screen/video-player.tsx index d808b6e..8b2ad77 100644 --- a/Frontend/src/components/video-recording-screen/video-player.tsx +++ b/Frontend/src/components/video-recording-screen/video-player.tsx @@ -1,6 +1,6 @@ import React, { useEffect, useRef, useState } from "react"; import { Camera } from "@/types"; -import { Tooltip } from "antd"; +import { Tooltip, Spin } from "antd"; import { FullscreenOutlined, FullscreenExitOutlined } from "@ant-design/icons"; const VideoPlayer = ({ @@ -12,6 +12,7 @@ const VideoPlayer = ({ }) => { const [fullScreen, setFullScreen] = useState(false); const [videoControlHidden, setvideoControlHidden] = useState(false); + const [loading, setLoading] = useState(true); const intervalRef: any = useRef(null); /* event handlers */ @@ -58,10 +59,8 @@ const VideoPlayer = ({ }, []); return ( -
+
+ {/* */}