Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
feat(prejoin) display recording warning (#14347)
Mihaela Dumitru7f889b20288a
diff --git a/config.js b/config.jsindex e5e0495668..a7eef88c1c 100644--- a/config.js+++ b/config.js@@ -329,6 +329,9 @@ var config = {// // If true, shows a notification at the start of the meeting with a call to action button// // to start recording (for users who can do so).// // suggestRecording: true,+ // // If true, shows a warning label in the prejoin screen to point out the possibility that+ // // the call you're joining might be recorded.+ // // showPrejoinWarning: true,// },// recordingService: {diff --git a/lang/main.json b/lang/main.jsonindex d7ffbb439c..2585859f08 100644--- a/lang/main.json+++ b/lang/main.json@@ -939,6 +939,7 @@"or": "or","premeeting": "Pre meeting","proceedAnyway": "Proceed anyway",+ "recordingWarning": "This call might be recorded","screenSharingError": "Screen sharing error:","showScreen": "Enable pre meeting screen","startWithPhone": "Start with phone audio",diff --git a/react/features/base/config/configType.ts b/react/features/base/config/configType.tsindex 339942024a..2e95e056e3 100644--- a/react/features/base/config/configType.ts+++ b/react/features/base/config/configType.ts@@ -531,6 +531,7 @@ export interface IConfig {};recordingSharingUrl?: string;recordings?: {+ showPrejoinWarning?: boolean;suggestRecording?: boolean;};remoteVideoMenu?: {diff --git a/react/features/base/premeeting/components/web/PreMeetingScreen.tsx b/react/features/base/premeeting/components/web/PreMeetingScreen.tsxindex facd6c4d47..1ccbd60182 100644--- a/react/features/base/premeeting/components/web/PreMeetingScreen.tsx+++ b/react/features/base/premeeting/components/web/PreMeetingScreen.tsx@@ -14,6 +14,7 @@ import { withPixelLineHeight } from '../../../styles/functions.web';import ConnectionStatus from './ConnectionStatus';import Preview from './Preview';+import RecordingWarning from './RecordingWarning';import UnsafeRoomWarning from './UnsafeRoomWarning';interface IProps {@@ -58,6 +59,11 @@ interface IProps {*/showDeviceStatus: boolean;+ /**+ * Indicates whether to display the recording warning.+ */+ showRecordingWarning?: boolean;+/*** If should show unsafe room warning when joining.*/@@ -168,6 +174,7 @@ const PreMeetingScreen = ({children,className,showDeviceStatus,+ showRecordingWarning,showUnsafeRoomWarning,skipPrejoinButton,title,@@ -199,6 +206,7 @@ const PreMeetingScreen = ({{children}{_buttons.length && <Toolbox toolbarButtons = { _buttons } />}{skipPrejoinButton}+ {showRecordingWarning && <RecordingWarning />}{showUnsafeRoomWarning && <UnsafeRoomWarning />}{showDeviceStatus && <DeviceStatus />}</div>diff --git a/react/features/base/premeeting/components/web/RecordingWarning.tsx b/react/features/base/premeeting/components/web/RecordingWarning.tsxnew file mode 100644index 0000000000..73d41985b0--- /dev/null+++ b/react/features/base/premeeting/components/web/RecordingWarning.tsx@@ -0,0 +1,56 @@+import React from 'react';+import { useTranslation } from 'react-i18next';+import { makeStyles } from 'tss-react/mui';++import Icon from '../../../icons/components/Icon';+import { IconRecord } from '../../../icons/svg';+import { withPixelLineHeight } from '../../../styles/functions.web';++const useStyles = makeStyles()(theme => {+ return {+ container: {+ backgroundColor: theme.palette.warning01,+ borderRadius: theme.shape.borderRadius,+ color: theme.palette.text04,+ display: 'flex',+ justifyContent: 'center',+ ...withPixelLineHeight(theme.typography.bodyShortRegular),+ marginBottom: theme.spacing(3),+ marginTop: theme.spacing(2),+ paddingBottom: theme.spacing(2),+ paddingTop: theme.spacing(2),+ width: '100%'+ },+ warning: {+ alignItems: 'center',+ display: 'flex',+ paddingLeft: theme.spacing(3),+ paddingRight: theme.spacing(3)+ },+ text: {+ fontWeight: 600,+ paddingLeft: theme.spacing(2)+ }+ };+});++const RecordingWarning = () => {+ const { t } = useTranslation();+ const { classes, theme } = useStyles();+ const color = theme.palette.icon04;++ return (+ <div className = { classes.container }>+ <div className = { classes.warning }>+ <Icon+ color = { color }+ src = { IconRecord } />+ <span className = { classes.text }>+ {t('prejoin.recordingWarning')}+ </span>+ </div>+ </div>+ );+};++export default RecordingWarning;diff --git a/react/features/prejoin/components/native/Prejoin.tsx b/react/features/prejoin/components/native/Prejoin.tsxindex 9ed62ac1f9..40eda717a1 100644--- a/react/features/prejoin/components/native/Prejoin.tsx+++ b/react/features/prejoin/components/native/Prejoin.tsx@@ -42,6 +42,7 @@ import { isDisplayNameRequired, isRoomNameEnabled } from '../../functions';import { IPrejoinProps } from '../../types';import { hasDisplayName } from '../../utils';+import RecordingWarning from './RecordingWarning';import { preJoinStyles as styles } from './styles';@@ -59,6 +60,8 @@ const Prejoin: React.FC<IPrejoinProps> = ({ navigation }: IPrejoinProps) => {const isDisplayNameReadonly = useSelector(isNameReadOnly);const roomName = useSelector((state: IReduxState) => getConferenceName(state));const roomNameEnabled = useSelector((state: IReduxState) => isRoomNameEnabled(state));+ const showRecordingWarning+ = useSelector((state: IReduxState) => state['features/base/config'].recordings?.showPrejoinWarning);const participantName = localParticipant?.name;const [ displayName, setDisplayName ]= useState(participantName || '');@@ -169,8 +172,8 @@ const Prejoin: React.FC<IPrejoinProps> = ({ navigation }: IPrejoinProps) => {{isFocused&& <View style = { largeVideoContainerStyles as StyleProp<ViewStyle> }>- {- roomNameEnabled && (+ <View style = { styles.conferenceInfo as StyleProp<ViewStyle> }>+ {roomNameEnabled && (<View style = { styles.displayRoomNameBackdrop as StyleProp<TextStyle> }><TextnumberOfLines = { 1 }@@ -178,8 +181,9 @@ const Prejoin: React.FC<IPrejoinProps> = ({ navigation }: IPrejoinProps) => {{ roomName }</Text></View>- )- }+ )}+ {showRecordingWarning && <RecordingWarning />}+ </View><LargeVideo /></View>}diff --git a/react/features/prejoin/components/native/RecordingWarning.tsx b/react/features/prejoin/components/native/RecordingWarning.tsxnew file mode 100644index 0000000000..79cd70f2a3--- /dev/null+++ b/react/features/prejoin/components/native/RecordingWarning.tsx@@ -0,0 +1,39 @@+import React from 'react';+import { useTranslation } from 'react-i18next';+import {+ StyleProp,+ Text,+ TextStyle,+ View,+ ViewStyle+} from 'react-native';++import Icon from '../../../base/icons/components/Icon';+import { IconRecord } from '../../../base/icons/svg';+import BaseTheme from '../../../base/ui/components/BaseTheme.native';++import { preJoinStyles as styles } from './styles';+++const RecordingWarning = (): JSX.Element => {+ const { t } = useTranslation();+ const color = BaseTheme.palette.icon04;++ return (+ <View style = { styles.recordingWarningContainer as StyleProp<ViewStyle> }>+ <View style = { styles.recordingWarning as StyleProp<ViewStyle> }>+ <Icon+ color = { color }+ size = { 20 }+ src = { IconRecord } />+ <Text+ numberOfLines = { 1 }+ style = { styles.recordingWarningText as StyleProp<TextStyle> }>+ { t('prejoin.recordingWarning') }+ </Text>+ </View>+ </View>+ );+};++export default RecordingWarning;diff --git a/react/features/prejoin/components/native/styles.ts b/react/features/prejoin/components/native/styles.tsindex 2346f8b130..4105e02ea2 100644--- a/react/features/prejoin/components/native/styles.ts+++ b/react/features/prejoin/components/native/styles.ts@@ -106,18 +106,47 @@ export const preJoinStyles = {textAlign: 'center'},- displayRoomNameBackdrop: {+ conferenceInfo: {alignSelf: 'center',- backgroundColor: BaseTheme.palette.uiBackground,- borderRadius: BaseTheme.shape.borderRadius,marginTop: BaseTheme.spacing[3],- opacity: 0.7,paddingHorizontal: BaseTheme.spacing[3],paddingVertical: BaseTheme.spacing[1],position: 'absolute',- maxWidth: 243,+ maxWidth: 273,zIndex: 1},+ displayRoomNameBackdrop: {+ backgroundColor: BaseTheme.palette.uiBackground,+ borderRadius: BaseTheme.shape.borderRadius,+ opacity: 0.7,+ paddingHorizontal: BaseTheme.spacing[3],+ paddingVertical: BaseTheme.spacing[1]+ },+ recordingWarningContainer: {+ backgroundColor: BaseTheme.palette.warning01,+ borderRadius: BaseTheme.shape.borderRadius,+ color: BaseTheme.palette.text04,+ display: 'flex',+ justifyContent: 'center',+ lineHeight: 22,+ marginBottom: BaseTheme.spacing[2],+ marginTop: BaseTheme.spacing[1],+ paddingBottom: BaseTheme.spacing[1],+ paddingTop: BaseTheme.spacing[1],+ width: 'auto'+ },+ recordingWarning: {+ alignItems: 'center',+ display: 'flex',+ flexDirection: 'row',+ justifyContent: 'center',+ paddingLeft: BaseTheme.spacing[2],+ paddingRight: BaseTheme.spacing[2]+ },+ recordingWarningText: {+ fontWeight: '600',+ paddingLeft: BaseTheme.spacing[1]+ },unsafeRoomWarningContainer: {height: '100%',width: '100%',diff --git a/react/features/prejoin/components/web/Prejoin.tsx b/react/features/prejoin/components/web/Prejoin.tsxindex 800bf9f26b..3d66d7463e 100644--- a/react/features/prejoin/components/web/Prejoin.tsx+++ b/react/features/prejoin/components/web/Prejoin.tsx@@ -111,6 +111,11 @@ interface IProps {*/showErrorOnJoin: boolean;+ /**+ * If the recording warning is visible or not.+ */+ showRecordingWarning: boolean;+/*** If should show unsafe room warning when joining.*/@@ -219,6 +224,7 @@ const Prejoin = ({showCameraPreview,showDialog,showErrorOnJoin,+ showRecordingWarning,showUnsafeRoomWarning,unsafeRoomConsent,updateSettings: dispatchUpdateSettings,@@ -390,6 +396,7 @@ const Prejoin = ({return (<PreMeetingScreenshowDeviceStatus = { deviceStatusVisible }+ showRecordingWarning = { showRecordingWarning }showUnsafeRoomWarning = { showUnsafeRoomWarning }title = { t('prejoin.joinMeeting') }videoMuted = { !showCameraPreview }@@ -483,6 +490,7 @@ function mapStateToProps(state: IReduxState) {const { joiningInProgress } = state['features/prejoin'];const { room } = state['features/base/conference'];const { unsafeRoomConsent } = state['features/base/premeeting'];+ const { showPrejoinWarning: showRecordingWarning } = state['features/base/config'].recordings ?? {};return {deviceStatusVisible: isDeviceStatusVisible(state),@@ -496,6 +504,7 @@ function mapStateToProps(state: IReduxState) {showCameraPreview: !isVideoMutedByUser(state),showDialog: isJoinByPhoneDialogVisible(state),showErrorOnJoin,+ showRecordingWarning: Boolean(showRecordingWarning),showUnsafeRoomWarning: isInsecureRoomName(room) && isUnsafeRoomWarningEnabled(state),unsafeRoomConsent,videoTrack: getLocalJitsiVideoTrack(state)