diff --git a/config.json b/config.json index 567e2e1e2..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, @@ -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 } 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 (