From f6397cc9c098a4e4dd16e2729282775f058c6804 Mon Sep 17 00:00:00 2001 From: Supriya Adep Date: Wed, 16 Oct 2024 17:39:19 +0530 Subject: [PATCH 1/3] stop cloud(mix) recording when there is only one user in the call --- .../subComponents/recording/useRecording.tsx | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/template/src/subComponents/recording/useRecording.tsx b/template/src/subComponents/recording/useRecording.tsx index 75f132f9e..81d9581d7 100644 --- a/template/src/subComponents/recording/useRecording.tsx +++ b/template/src/subComponents/recording/useRecording.tsx @@ -849,6 +849,33 @@ const RecordingProvider = (props: RecordingProviderProps) => { _stopRecording, ]); + useEffect(() => { + return () => { + if (recordingMode === 'MIX' && isRecordingActive) { + const totalUsers = hostUids?.length + audienceUids?.length; + logger.log( + LogSource.Internals, + 'RECORDING', + 'checking if you should stop recording on component unmount', + { + recordingMode, + isRecordingActive, + users: totalUsers, + }, + ); + if (totalUsers === 1) { + logger.log( + LogSource.Internals, + 'RECORDING', + 'stopping cloud(mix) recording as there is no user in the call', + ); + stopRecording(); + } + } + }; + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + // auto start recording useEffect(() => { if ( From 7a286cd00d57d9ad640abc995019b196baf220d1 Mon Sep 17 00:00:00 2001 From: Supriya Adep Date: Fri, 25 Oct 2024 11:30:37 +0530 Subject: [PATCH 2/3] disable auto start recording --- config.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.json b/config.json index 567e2e1e2..702551209 100644 --- a/config.json +++ b/config.json @@ -93,6 +93,6 @@ "CHAT_URL": "https://a41.chat.agora.io", "ENABLE_NOISE_CANCELLATION_BY_DEFAULT": true, "DISABLE_LANDSCAPE_MODE": false, - "STT_AUTO_START": true, - "CLOUD_RECORDING_AUTO_START": true + "STT_AUTO_START": false, + "CLOUD_RECORDING_AUTO_START": false } From 28c6cf2f5df979280fab33b3470c133370e9c278 Mon Sep 17 00:00:00 2001 From: Supriya Adep Date: Fri, 25 Oct 2024 11:31:06 +0530 Subject: [PATCH 3/3] recording mode mix --- config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.json b/config.json index 702551209..0480e2853 100644 --- a/config.json +++ b/config.json @@ -14,7 +14,7 @@ "PRECALL": true, "CHAT": true, "CLOUD_RECORDING": true, - "RECORDING_MODE": "WEB", + "RECORDING_MODE": "MIX", "SCREEN_SHARING": true, "LANDING_SUB_HEADING": "The Real-Time Engagement Platform", "ENCRYPTION_ENABLED": true,