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(recording): Add separate transcription indicator with contextual notifications (#17153)
Mihaela Dumitru6534e6f277ee
diff --git a/lang/main-fr-CA.json b/lang/main-fr-CA.jsonindex 8e95af91ef..552185037c 100644--- a/lang/main-fr-CA.json+++ b/lang/main-fr-CA.json@@ -1494,6 +1494,10 @@"failed": "La transcription a échoué","labelTooltip": "La transcription de la réunion est en cours","labelTooltipExtra": "De plus, une transcription sera disponible plus tard.",+ "off": "Transcription arrêtée",+ "on": "Transcription démarrée",+ "onBy": "{{name}} a démarré la transcription",+ "onWithRecording": "Une transcription sera également disponible après la réunion.","openClosedCaptions": "Ouvrir les sous-titres","original": "Original","sourceLanguageDesc": "Actuellement, la langue de la réunion est sélectionnée à <b>{{sourceLanguage}}</b>. <br/> Vous pouvez la changer à partir de ",diff --git a/lang/main-fr.json b/lang/main-fr.jsonindex 6841b7508e..0785420d5c 100644--- a/lang/main-fr.json+++ b/lang/main-fr.json@@ -1518,6 +1518,10 @@"failed": "La transcription a échoué","labelTooltip": "La transcription de la réunion est en cours","labelTooltipExtra": "Une transcription sera disponible plus tard.",+ "off": "Transcription arrêtée",+ "on": "Transcription démarrée",+ "onBy": "{{name}} a démarré la transcription",+ "onWithRecording": "Une transcription sera également disponible après la réunion.","openClosedCaptions": "Ouvrir les sous-titres","original": "Original","sourceLanguageDesc": "Actuellement, la langue de la réunion est sélectionnée à <b>{{sourceLanguage}}</b>. <br/> Vous pouvez la changer à partir de ",diff --git a/lang/main.json b/lang/main.jsonindex bf2b3a02ac..d697beb2ea 100644--- a/lang/main.json+++ b/lang/main.json@@ -1149,6 +1149,8 @@"offBy": "{{name}} stopped the recording","on": "Recording started","onBy": "{{name}} started the recording",+ "onByWithTranscription": "{{name}} started the recording. A transcript will also be available after the meeting.",+ "onWithTranscription": "Recording started. A transcript will also be available after the meeting.","onlyRecordSelf": "Record only my audio and video streams","pending": "Preparing to record the meeting…","policyError": "You tried to start a recording too quickly. Please try again later!",@@ -1526,6 +1528,10 @@"failed": "Transcribing failed","labelTooltip": "This meeting is being transcribed.","labelTooltipExtra": "In addition, a transcript will be available later.",+ "off": "Transcription stopped",+ "on": "Transcription started",+ "onBy": "{{name}} started the transcription",+ "onWithRecording": "A transcript will also be available after the meeting.","openClosedCaptions": "Open closed captions","original": "Original","sourceLanguageDesc": "Currently the meeting language is set to <b>{{sourceLanguage}}</b>. <br/> You can change it from ",diff --git a/react/features/base/icons/svg/constants.ts b/react/features/base/icons/svg/constants.tsindex bac39f7629..4bee92532f 100644--- a/react/features/base/icons/svg/constants.ts+++ b/react/features/base/icons/svg/constants.ts@@ -89,6 +89,7 @@ import { default as IconRemoteControlStop } from './stop-remote-control.svg';import { default as IconStop } from './stop.svg';import { default as IconSubtitles } from './subtitles.svg';import { default as IconTileView } from './tile-view.svg';+import { default as IconTranscription } from './transcription.svg';import { default as IconTrash } from './trash.svg';import { default as IconUserDeleted } from './user-deleted.svg';import { default as IconUser } from './user.svg';@@ -183,6 +184,7 @@ export const DEFAULT_ICON: Record<string, any> = {IconPlus,IconRaiseHand,IconRecord,+ IconTranscription,IconRecordAccount,IconRecordContact,IconRecordLead,diff --git a/react/features/base/icons/svg/index.ts b/react/features/base/icons/svg/index.tsindex 8d3a5fadf4..3c77e14355 100644--- a/react/features/base/icons/svg/index.ts+++ b/react/features/base/icons/svg/index.ts@@ -74,6 +74,7 @@ const {IconPlus,IconRaiseHand,IconRecord,+ IconTranscription,IconRecordAccount,IconRecordContact,IconRecordLead,@@ -194,6 +195,7 @@ export {IconPlus,IconRaiseHand,IconRecord,+ IconTranscription,IconRecordAccount,IconRecordContact,IconRecordLead,diff --git a/react/features/base/icons/svg/transcription.svg b/react/features/base/icons/svg/transcription.svgnew file mode 100644index 0000000000..cf8cb44efe--- /dev/null+++ b/react/features/base/icons/svg/transcription.svg@@ -0,0 +1,4 @@+<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">+ <path fill-rule="evenodd" clip-rule="evenodd" d="M15.5852 12.75L17.327 16.2909C17.5098 16.6626 17.9593 16.8157 18.331 16.6329C18.7027 16.4501 18.8558 16.0006 18.673 15.6289L12.6414 3.36696C12.2255 2.52157 11.017 2.53122 10.6146 3.38315L4.5718 16.1797C4.39494 16.5542 4.55519 16.9012 4.92974 17.0781C5.3043 17.255 5.65131 17.0947 5.82818 16.7202L7.85021 12.75H15.5852ZM14.8474 11.25L11.6388 4.72714L8.55854 11.25H14.8474Z" />+ <path d="M3 20.25C3 19.8358 3.33579 19.5 3.75 19.5H20.25C20.6642 19.5 21 19.8358 21 20.25C21 20.6642 20.6642 21 20.25 21H3.75C3.33579 21 3 20.6642 3 20.25Z" />+</svg>diff --git a/react/features/base/media/functions.ts b/react/features/base/media/functions.tsindex 84340958af..8c1a310d91 100644--- a/react/features/base/media/functions.ts+++ b/react/features/base/media/functions.ts@@ -146,11 +146,18 @@ export function shouldRenderVideoTrack(* @returns {string}*/export const getSoundFileSrc = (file: string, language: string): string => {- if (!AudioSupportedLanguage[language as keyof typeof AudioSupportedLanguage]- || language === AudioSupportedLanguage.en) {+ if (!language) {+ return file;+ }++ // Normalize language code: 'fr-CA' -> 'frCA' to match AudioSupportedLanguage enum and file naming+ const normalizedLanguage = language.replace('-', '');++ if (!AudioSupportedLanguage[normalizedLanguage as keyof typeof AudioSupportedLanguage]+ || normalizedLanguage === AudioSupportedLanguage.en) {return file;}const fileTokens = file.split('.');- return `${fileTokens[0]}_${language}.${fileTokens[1]}`;+ return `${fileTokens[0]}_${normalizedLanguage}.${fileTokens[1]}`;};diff --git a/react/features/base/participants/middleware.ts b/react/features/base/participants/middleware.tsindex 14ff70a412..0f8a5010f8 100644--- a/react/features/base/participants/middleware.ts+++ b/react/features/base/participants/middleware.ts@@ -789,8 +789,9 @@ function _localRecordingUpdated({ dispatch, getState }: IStore, conference: IJitparticipantId: string, newValue: boolean) {const state = getState();const participant = getParticipantById(state, participantId);+ const currentValue = participant?.localRecording ?? false;- if (participant?.localRecording === newValue) {+ if (currentValue === newValue) {return;}diff --git a/react/features/base/ui/Tokens.ts b/react/features/base/ui/Tokens.tsindex 9469e5a05d..4e181d67ea 100644--- a/react/features/base/ui/Tokens.ts+++ b/react/features/base/ui/Tokens.ts@@ -370,6 +370,7 @@ export const colorMap = {recordingHighlightButtonIconDisabled: 'text03', // Recording highlight button disabled icon colorrecordingNotificationText: 'surface01', // Recording notification text colorrecordingNotificationAction: 'action01', // Recording notification action color+ transcriptionIndicator: 'success01', // Transcription indicator background// Virtual BackgroundvirtualBackgroundBackground: 'ui01', // Virtual background picker backgrounddiff --git a/react/features/base/ui/types.ts b/react/features/base/ui/types.tsindex a0865e9041..5c3e809330 100644--- a/react/features/base/ui/types.ts+++ b/react/features/base/ui/types.ts@@ -326,6 +326,7 @@ export interface IPalette {recordingNotificationAction: string;recordingNotificationText: string;recordingText: string;+ transcriptionIndicator: string;securityDialogBackground: string;securityDialogBorder: string;securityDialogSecondaryText: string;diff --git a/react/features/conference/components/native/AlwaysOnLabels.tsx b/react/features/conference/components/native/AlwaysOnLabels.tsxindex 4ae76745dd..780efc4b0f 100644--- a/react/features/conference/components/native/AlwaysOnLabels.tsx+++ b/react/features/conference/components/native/AlwaysOnLabels.tsx@@ -6,6 +6,7 @@ import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';import { openHighlightDialog } from '../../../recording/actions.native';import HighlightButton from '../../../recording/components/Recording/native/HighlightButton';import RecordingLabel from '../../../recording/components/native/RecordingLabel';+import TranscribingLabel from '../../../recording/components/native/TranscribingLabel';import { isLiveStreamingRunning } from '../../../recording/functions';import VisitorsCountLabel from '../../../visitors/components/native/VisitorsCountLabel';@@ -14,6 +15,7 @@ import {LABEL_ID_RAISED_HANDS_COUNT,LABEL_ID_RECORDING,LABEL_ID_STREAMING,+ LABEL_ID_TRANSCRIBING,LABEL_ID_VISITORS_COUNT,LabelHitSlop} from './constants';@@ -47,6 +49,11 @@ const AlwaysOnLabels = ({ createOnPress }: IProps) => {<RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } /></TouchableOpacity>}+ <TouchableOpacity+ hitSlop = { LabelHitSlop }+ onPress = { createOnPress(LABEL_ID_TRANSCRIBING) } >+ <TranscribingLabel />+ </TouchableOpacity><TouchableOpacityhitSlop = { LabelHitSlop }onPress = { openHighlightDialogCallback }>diff --git a/react/features/conference/components/native/constants.ts b/react/features/conference/components/native/constants.tsindex ce88cc8cd0..6cebc06d67 100644--- a/react/features/conference/components/native/constants.ts+++ b/react/features/conference/components/native/constants.ts@@ -2,6 +2,7 @@ import React from 'react';import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';import RecordingExpandedLabel from '../../../recording/components/native/RecordingExpandedLabel';+import TranscribingExpandedLabel from '../../../recording/components/native/TranscribingExpandedLabel';import VideoQualityExpandedLabel from '../../../video-quality/components/VideoQualityExpandedLabel.native';import InsecureRoomNameExpandedLabel from './InsecureRoomNameExpandedLabel';@@ -22,6 +23,7 @@ export const EXPANDED_LABEL_TIMEOUT = 5000;export const LABEL_ID_QUALITY = 'quality';export const LABEL_ID_RECORDING = 'recording';export const LABEL_ID_STREAMING = 'streaming';+export const LABEL_ID_TRANSCRIBING = 'transcribing';export const LABEL_ID_INSECURE_ROOM_NAME = 'insecure-room-name';export const LABEL_ID_RAISED_HANDS_COUNT = 'raised-hands-count';export const LABEL_ID_VISITORS_COUNT = 'visitors-count';@@ -56,6 +58,10 @@ export const EXPANDED_LABELS: {},alwaysOn: true},+ [LABEL_ID_TRANSCRIBING]: {+ component: TranscribingExpandedLabel,+ alwaysOn: true+ },[LABEL_ID_INSECURE_ROOM_NAME]: {component: InsecureRoomNameExpandedLabel},diff --git a/react/features/conference/components/web/ConferenceInfo.tsx b/react/features/conference/components/web/ConferenceInfo.tsxindex 83780cd924..a2092cac5a 100644--- a/react/features/conference/components/web/ConferenceInfo.tsx+++ b/react/features/conference/components/web/ConferenceInfo.tsx@@ -7,6 +7,7 @@ import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';import E2EELabel from '../../../e2ee/components/E2EELabel';import HighlightButton from '../../../recording/components/Recording/web/HighlightButton';import RecordingLabel from '../../../recording/components/web/RecordingLabel';+import TranscribingLabel from '../../../recording/components/web/TranscribingLabel';import { showToolbox } from '../../../toolbox/actions.web';import { isToolboxVisible } from '../../../toolbox/functions.web';import VideoQualityLabel from '../../../video-quality/components/VideoQualityLabel.web';@@ -79,6 +80,7 @@ const COMPONENTS: Array<{<><RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } /><RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } />+ <TranscribingLabel /></>),id: 'recording'diff --git a/react/features/recording/actions.any.ts b/react/features/recording/actions.any.tsindex 1478c65dae..1dc42983e4 100644--- a/react/features/recording/actions.any.ts+++ b/react/features/recording/actions.any.ts@@ -256,14 +256,37 @@ export function showStartedRecordingNotification(const recordingSharingUrl = getRecordingSharingUrl(state);const iAmRecordingInitiator = getLocalParticipant(state)?.id === initiatorId;const { showRecordingLink } = state['features/base/config'].recordings || {};-- notifyProps.dialogProps = {- customActionHandler: undefined,- customActionNameKey: undefined,- descriptionKey: participantName ? 'recording.onBy' : 'recording.on',- descriptionArguments: { name: participantName },- titleKey: 'dialog.recording'- };+ const isTranscribing = isRecorderTranscriptionsRunning(state);+ const isRecording = isRecordingRunning(state);++ // Case 1: Transcription only (no recording)+ if (isTranscribing && !isRecording) {+ notifyProps.dialogProps = {+ customActionHandler: undefined,+ customActionNameKey: undefined,+ descriptionKey: participantName ? 'transcribing.onBy' : 'transcribing.on',+ descriptionArguments: { name: participantName },+ titleKey: 'dialog.recording'+ };+ } else if (isTranscribing && isRecording) {+ // Case 2: Recording + transcription+ notifyProps.dialogProps = {+ customActionHandler: undefined,+ customActionNameKey: undefined,+ descriptionKey: participantName ? 'recording.onByWithTranscription' : 'recording.onWithTranscription',+ descriptionArguments: { name: participantName },+ titleKey: 'dialog.recording'+ };+ } else {+ // Case 3: Recording only (no transcription)+ notifyProps.dialogProps = {+ customActionHandler: undefined,+ customActionNameKey: undefined,+ descriptionKey: participantName ? 'recording.onBy' : 'recording.on',+ descriptionArguments: { name: participantName },+ titleKey: 'dialog.recording'+ };+ }// fetch the recording link from the server for recording initiators in jaas meetingsif (recordingSharingUrldiff --git a/react/features/recording/components/AbstractRecordingLabel.ts b/react/features/recording/components/AbstractRecordingLabel.tsindex f1f4f5fe69..30abf50ac5 100644--- a/react/features/recording/components/AbstractRecordingLabel.ts+++ b/react/features/recording/components/AbstractRecordingLabel.ts@@ -84,8 +84,7 @@ export function _mapStateToProps(state: IReduxState, ownProps: any) {const _isLivestreamingRunning = isLiveStreamingRunning(state);const _isVisible = isLiveStreamingLabel? _isLivestreamingRunning // this is the livestreaming label- : isRecordingRunning(state) || isRemoteParticipantRecordingLocally(state)- || _isTranscribing; // this is the recording label+ : isRecordingRunning(state) || isRemoteParticipantRecordingLocally(state); // this is the recording labelreturn {_isVisible,diff --git a/react/features/recording/components/Recording/AbstractStopRecordingDialog.ts b/react/features/recording/components/Recording/AbstractStopRecordingDialog.tsindex 7817186a54..a49a69e0d9 100644--- a/react/features/recording/components/Recording/AbstractStopRecordingDialog.ts+++ b/react/features/recording/components/Recording/AbstractStopRecordingDialog.ts@@ -102,8 +102,8 @@ export default class AbstractStopRecordingDialog<P extends IProps>if (localRecordingVideoStop) {dispatch(setVideoMuted(true));}- } else {- _conference?.stopRecording(_fileRecordingSession?.id);+ } else if (_fileRecordingSession) {+ _conference?.stopRecording(_fileRecordingSession.id);this._toggleScreenshotCapture();}diff --git a/react/features/recording/components/native/TranscribingExpandedLabel.ts b/react/features/recording/components/native/TranscribingExpandedLabel.tsnew file mode 100644index 0000000000..9eab1e6996--- /dev/null+++ b/react/features/recording/components/native/TranscribingExpandedLabel.ts@@ -0,0 +1,55 @@+import { WithTranslation } from 'react-i18next';+import { connect } from 'react-redux';++import { IReduxState } from '../../../app/types';+import { translate } from '../../../base/i18n/functions';+import ExpandedLabel, { IProps as AbstractProps } from '../../../base/label/components/native/ExpandedLabel';+import { isRecorderTranscriptionsRunning } from '../../../transcribing/functions';++interface IProps extends AbstractProps, WithTranslation {++ /**+ * Whether this meeting is being transcribed.+ */+ _isTranscribing?: boolean;+}++/**+ * A react {@code Component} that implements an expanded label as tooltip-like+ * component to explain the meaning of the {@code TranscribingLabel}.+ */+class TranscribingExpandedLabel extends ExpandedLabel<IProps> {++ /**+ * Returns the label specific text of this {@code ExpandedLabel}.+ *+ * @returns {string}+ */+ _getLabel() {+ const { _isTranscribing, t } = this.props;++ if (_isTranscribing) {+ return t('transcribing.labelTooltip');+ }++ return t('transcribing.expandedOff');+ }+}++/**+ * Maps (parts of) the Redux state to the associated+ * {@code TranscribingExpandedLabel}'s props.+ *+ * @param {Object} state - The Redux state.+ * @private+ * @returns {{+ * _isTranscribing: boolean+ * }}+ */+function _mapStateToProps(state: IReduxState) {+ return {+ _isTranscribing: isRecorderTranscriptionsRunning(state)+ };+}++export default translate(connect(_mapStateToProps)(TranscribingExpandedLabel));diff --git a/react/features/recording/components/native/TranscribingLabel.tsx b/react/features/recording/components/native/TranscribingLabel.tsxnew file mode 100644index 0000000000..6ab0882c44--- /dev/null+++ b/react/features/recording/components/native/TranscribingLabel.tsx@@ -0,0 +1,64 @@+import React from 'react';+import { connect } from 'react-redux';++import { translate } from '../../../base/i18n/functions';+import { IconTranscription } from '../../../base/icons/svg';+import Label from '../../../base/label/components/native/Label';+import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';+import { StyleType } from '../../../base/styles/functions.any';+import { isRecorderTranscriptionsRunning } from '../../../transcribing/functions';+import AbstractRecordingLabel, {+ IProps as AbstractProps+} from '../AbstractRecordingLabel';++import styles from './styles';++/**+ * Implements a React {@link Component} which displays the current state of+ * transcription.+ *+ * @augments {Component}+ */+class TranscribingLabel extends AbstractRecordingLabel<AbstractProps> {++ /**+ * Renders the platform specific label component.+ *+ * @inheritdoc+ */+ _renderLabel() {+ const { _isTranscribing } = this.props;++ if (!_isTranscribing) {+ return null;+ }++ return (+ <Label+ icon = { IconTranscription }+ status = { 'on' }+ style = { styles.transcribingIndicatorStyle as StyleType } />+ );+ }+}++/**+ * Maps (parts of) the Redux state to the associated props.+ *+ * @param {Object} state - The Redux state.+ * @private+ * @returns {Object}+ */+function _mapStateToProps(state: any) {+ const _isTranscribing = isRecorderTranscriptionsRunning(state);++ return {+ _isVisible: _isTranscribing,+ _iAmRecorder: Boolean(state['features/base/config'].iAmRecorder),+ _isTranscribing,+ mode: 'transcribing', // Custom mode for transcription+ _status: _isTranscribing ? JitsiRecordingConstants.status.ON : JitsiRecordingConstants.status.OFF+ };+}++export default translate(connect(_mapStateToProps)(TranscribingLabel));diff --git a/react/features/recording/components/native/styles.ts b/react/features/recording/components/native/styles.tsindex 8d1194eea0..cf5e19faa7 100644--- a/react/features/recording/components/native/styles.ts+++ b/react/features/recording/components/native/styles.ts@@ -14,5 +14,15 @@ export default createStyleSheet({marginLeft: 0,marginBottom: 0,backgroundColor: BaseTheme.palette.iconError+ },++ /**+ * Style for the transcription indicator.+ */+ transcribingIndicatorStyle: {+ marginRight: 4,+ marginLeft: 0,+ marginBottom: 0,+ backgroundColor: BaseTheme.palette.transcriptionIndicator}});diff --git a/react/features/recording/components/web/RecordingLabel.tsx b/react/features/recording/components/web/RecordingLabel.tsxindex d5e55d992b..3a444e8db1 100644--- a/react/features/recording/components/web/RecordingLabel.tsx+++ b/react/features/recording/components/web/RecordingLabel.tsx@@ -3,6 +3,8 @@ import React from 'react';import { connect } from 'react-redux';import { withStyles } from 'tss-react/mui';+import { IStore } from '../../../app/types';+import { openDialog } from '../../../base/dialog/actions';import { translate } from '../../../base/i18n/functions';import { IconRecord, IconSites } from '../../../base/icons/svg';import Label from '../../../base/label/components/web/Label';@@ -12,6 +14,7 @@ import AbstractRecordingLabel, {IProps as AbstractProps,_mapStateToProps} from '../AbstractRecordingLabel';+import StopRecordingDialog from '../Recording/web/StopRecordingDialog';interface IProps extends AbstractProps {@@ -20,6 +23,11 @@ interface IProps extends AbstractProps {*/classes?: Partial<Record<keyof ReturnType<typeof styles>, string>>;+ /**+ * The Redux dispatch function.+ */+ dispatch: IStore['dispatch'];+}/**@@ -44,13 +52,33 @@ const styles = (theme: Theme) => {* @augments {Component}*/class RecordingLabel extends AbstractRecordingLabel<IProps> {+ /**+ * Initializes a new {@code RecordingLabel} instance.+ *+ * @param {IProps} props - The props of the component.+ */+ constructor(props: IProps) {+ super(props);++ this._onClick = this._onClick.bind(this);+ }++ /**+ * Handles clicking on the label.+ *+ * @returns {void}+ */+ _onClick() {+ this.props.dispatch(openDialog('StopRecordingDialog', StopRecordingDialog));+ }+/*** Renders the platform specific label component.** @inheritdoc*/override _renderLabel() {- const { _isTranscribing, _status, mode, t } = this.props;+ const { _status, mode, t } = this.props;const classes = withStyles.getClasses(this.props);const isRecording = mode === JitsiRecordingConstants.mode.FILE;const icon = isRecording ? IconRecord : IconSites;@@ -58,14 +86,8 @@ class RecordingLabel extends AbstractRecordingLabel<IProps> {if (_status === JitsiRecordingConstants.status.ON) {content = t(isRecording ? 'videoStatus.recording' : 'videoStatus.streaming');-- if (_isTranscribing) {- content += ` ${t('transcribing.labelTooltipExtra')}`;- }} else if (mode === JitsiRecordingConstants.mode.STREAM) {return null;- } else if (_isTranscribing) {- content = t('transcribing.labelTooltip');} else {return null;}@@ -76,7 +98,8 @@ class RecordingLabel extends AbstractRecordingLabel<IProps> {position = { 'bottom' }><LabelclassName = { classes.record }- icon = { icon } />+ icon = { icon }+ onClick = { this._onClick } /></Tooltip>);}diff --git a/react/features/recording/components/web/TranscribingLabel.tsx b/react/features/recording/components/web/TranscribingLabel.tsxnew file mode 100644index 0000000000..d6ef4e1268--- /dev/null+++ b/react/features/recording/components/web/TranscribingLabel.tsx@@ -0,0 +1,120 @@+import { Theme } from '@mui/material';+import React from 'react';+import { connect } from 'react-redux';+import { withStyles } from 'tss-react/mui';++import { IReduxState, IStore } from '../../../app/types';+import { openDialog } from '../../../base/dialog/actions';+import { translate } from '../../../base/i18n/functions';+import { IconTranscription } from '../../../base/icons/svg';+import Label from '../../../base/label/components/web/Label';+import Tooltip from '../../../base/tooltip/components/Tooltip';+import { isRecorderTranscriptionsRunning } from '../../../transcribing/functions';+import AbstractRecordingLabel, {+ IProps as AbstractProps+} from '../AbstractRecordingLabel';+import StopRecordingDialog from '../Recording/web/StopRecordingDialog';++interface IProps extends AbstractProps {++ /**+ * An object containing the CSS classes.+ */+ classes?: Partial<Record<keyof ReturnType<typeof styles>, string>>;++ /**+ * The Redux dispatch function.+ */+ dispatch: IStore['dispatch'];++}++/**+ * Creates the styles for the component.+ *+ * @param {Object} theme - The current UI theme.+ *+ * @returns {Object}+ */+const styles = (theme: Theme) => {+ return {+ transcribing: {+ background: theme.palette.transcriptionIndicator+ }+ };+};++/**+ * Implements a React {@link Component} which displays the current state of+ * transcription.+ *+ * @augments {Component}+ */+class TranscribingLabel extends AbstractRecordingLabel<IProps> {+ /**+ * Initializes a new {@code TranscribingLabel} instance.+ *+ * @param {IProps} props - The props of the component.+ */+ constructor(props: IProps) {+ super(props);++ this._onClick = this._onClick.bind(this);+ }++ /**+ * Handles clicking on the label.+ *+ * @returns {void}+ */+ _onClick() {+ this.props.dispatch(openDialog('StopRecordingDialog', StopRecordingDialog));+ }++ /**+ * Renders the platform specific label component.+ *+ * @inheritdoc+ */+ override _renderLabel() {+ const { _isTranscribing, t } = this.props;+ const classes = withStyles.getClasses(this.props);++ if (!_isTranscribing) {+ return null;+ }++ const content = t('transcribing.labelTooltip');++ return (+ <Tooltip+ content = { content }+ position = { 'bottom' }>+ <Label+ className = { classes.transcribing }+ icon = { IconTranscription }+ onClick = { this._onClick } />+ </Tooltip>+ );+ }+}++/**+ * Maps (parts of) the Redux state to the associated props.+ *+ * @param {Object} state - The Redux state.+ * @private+ * @returns {Object}+ */+function _mapStateToProps(state: IReduxState) {+ const _isTranscribing = isRecorderTranscriptionsRunning(state);++ return {+ _isVisible: _isTranscribing,+ _iAmRecorder: Boolean(state['features/base/config'].iAmRecorder),+ _isTranscribing,+ mode: 'transcribing' // Custom mode for transcription+ };+}++export default withStyles(translate(connect(_mapStateToProps)(TranscribingLabel)), styles);diff --git a/react/features/recording/constants.ts b/react/features/recording/constants.tsindex 942256e31c..fceb20955f 100644--- a/react/features/recording/constants.ts+++ b/react/features/recording/constants.ts@@ -36,6 +36,34 @@ export const RECORDING_OFF_SOUND_ID = 'RECORDING_OFF_SOUND';*/export const RECORDING_ON_SOUND_ID = 'RECORDING_ON_SOUND';+/**+ * The identifier of the sound to be played when transcription is stopped.+ *+ * @type {string}+ */+export const TRANSCRIPTION_OFF_SOUND_ID = 'TRANSCRIPTION_OFF_SOUND';++/**+ * The identifier of the sound to be played when transcription is started.+ *+ * @type {string}+ */+export const TRANSCRIPTION_ON_SOUND_ID = 'TRANSCRIPTION_ON_SOUND';++/**+ * The identifier of the sound to be played when recording and transcription are stopped.+ *+ * @type {string}+ */+export const RECORDING_AND_TRANSCRIPTION_OFF_SOUND_ID = 'RECORDING_AND_TRANSCRIPTION_OFF_SOUND';++/**+ * The identifier of the sound to be played when recording and transcription are started.+ *+ * @type {string}+ */+export const RECORDING_AND_TRANSCRIPTION_ON_SOUND_ID = 'RECORDING_AND_TRANSCRIPTION_ON_SOUND';+/*** Expected supported recording types.*diff --git a/react/features/recording/functions.ts b/react/features/recording/functions.tsindex 59d392cb30..995e49ba47 100644--- a/react/features/recording/functions.ts+++ b/react/features/recording/functions.ts@@ -19,17 +19,25 @@ import LocalRecordingManager from './components/Recording/LocalRecordingManager'import {LIVE_STREAMING_OFF_SOUND_ID,LIVE_STREAMING_ON_SOUND_ID,+ RECORDING_AND_TRANSCRIPTION_OFF_SOUND_ID,+ RECORDING_AND_TRANSCRIPTION_ON_SOUND_ID,RECORDING_OFF_SOUND_ID,RECORDING_ON_SOUND_ID,RECORDING_STATUS_PRIORITIES,- RECORDING_TYPES+ RECORDING_TYPES,+ TRANSCRIPTION_OFF_SOUND_ID,+ TRANSCRIPTION_ON_SOUND_ID} from './constants';import logger from './logger';import {LIVE_STREAMING_OFF_SOUND_FILE,LIVE_STREAMING_ON_SOUND_FILE,+ RECORDING_AND_TRANSCRIPTION_OFF_SOUND_FILE,+ RECORDING_AND_TRANSCRIPTION_ON_SOUND_FILE,RECORDING_OFF_SOUND_FILE,- RECORDING_ON_SOUND_FILE+ RECORDING_ON_SOUND_FILE,+ TRANSCRIPTION_OFF_SOUND_FILE,+ TRANSCRIPTION_ON_SOUND_FILE} from './sounds';/**@@ -384,6 +392,10 @@ export function unregisterRecordingAudioFiles(dispatch: IStore['dispatch']) {dispatch(unregisterSound(LIVE_STREAMING_ON_SOUND_FILE));dispatch(unregisterSound(RECORDING_OFF_SOUND_FILE));dispatch(unregisterSound(RECORDING_ON_SOUND_FILE));+ dispatch(unregisterSound(TRANSCRIPTION_OFF_SOUND_FILE));+ dispatch(unregisterSound(TRANSCRIPTION_ON_SOUND_FILE));+ dispatch(unregisterSound(RECORDING_AND_TRANSCRIPTION_OFF_SOUND_FILE));+ dispatch(unregisterSound(RECORDING_AND_TRANSCRIPTION_ON_SOUND_FILE));}/**@@ -415,6 +427,22 @@ export function registerRecordingAudioFiles(dispatch: IStore['dispatch'], shoulddispatch(registerSound(RECORDING_ON_SOUND_ID,getSoundFileSrc(RECORDING_ON_SOUND_FILE, language)));++ dispatch(registerSound(+ TRANSCRIPTION_OFF_SOUND_ID,+ getSoundFileSrc(TRANSCRIPTION_OFF_SOUND_FILE, language)));++ dispatch(registerSound(+ TRANSCRIPTION_ON_SOUND_ID,+ getSoundFileSrc(TRANSCRIPTION_ON_SOUND_FILE, language)));++ dispatch(registerSound(+ RECORDING_AND_TRANSCRIPTION_OFF_SOUND_ID,+ getSoundFileSrc(RECORDING_AND_TRANSCRIPTION_OFF_SOUND_FILE, language)));++ dispatch(registerSound(+ RECORDING_AND_TRANSCRIPTION_ON_SOUND_ID,+ getSoundFileSrc(RECORDING_AND_TRANSCRIPTION_ON_SOUND_FILE, language)));}/**diff --git a/react/features/recording/middleware.ts b/react/features/recording/middleware.tsindex 209bddc82e..060bde76e7 100644--- a/react/features/recording/middleware.ts+++ b/react/features/recording/middleware.ts@@ -51,6 +51,8 @@ import LocalRecordingManager from './components/Recording/LocalRecordingManager'import {LIVE_STREAMING_OFF_SOUND_ID,LIVE_STREAMING_ON_SOUND_ID,+ RECORDING_AND_TRANSCRIPTION_OFF_SOUND_ID,+ RECORDING_AND_TRANSCRIPTION_ON_SOUND_ID,RECORDING_OFF_SOUND_ID,RECORDING_ON_SOUND_ID,START_RECORDING_NOTIFICATION_ID@@ -64,6 +66,11 @@ import {} from './functions';import logger from './logger';+/**+ * Map to track which recording sessions have transcription enabled.+ */+const sessionsWithTranscription = new Map<string, boolean>();+/*** StateListenerRegistry provides a reliable way to detect the leaving of a* conference, where we need to clean up the recording sessions.@@ -247,9 +254,23 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {sendAnalytics(createRecordingEvent('start', mode));let soundID;+ const isTranscribing = isRecorderTranscriptionsRunning(state);+ const isRequestingTranscription = state['features/subtitles']._requestingSubtitles;+ const willTranscribe = isTranscribing || isRequestingTranscription;++ // Store whether transcription was enabled when recording started+ if (mode === JitsiRecordingConstants.mode.FILE) {+ const sessionId = action.sessionData.id;- if (mode === JitsiRecordingConstants.mode.FILE && !isRecorderTranscriptionsRunning(state)) {- soundID = RECORDING_ON_SOUND_ID;+ if (sessionId) {+ sessionsWithTranscription.set(sessionId, willTranscribe);+ }++ if (willTranscribe) {+ soundID = RECORDING_AND_TRANSCRIPTION_ON_SOUND_ID;+ } else {+ soundID = RECORDING_ON_SOUND_ID;+ }} else if (mode === JitsiRecordingConstants.mode.STREAM) {soundID = LIVE_STREAMING_ON_SOUND_ID;}@@ -264,11 +285,11 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {}}} else if (updatedSessionData?.status === OFF && oldSessionData?.status !== OFF) {- if (terminator) {- dispatch(- showStoppedRecordingNotification(- mode, getParticipantDisplayName(state, getResourceId(terminator))));- }+ const participantName = terminator+ ? getParticipantDisplayName(state, getResourceId(terminator))+ : undefined;++ dispatch(showStoppedRecordingNotification(mode, participantName));let duration = 0, soundOff, soundOn;@@ -278,9 +299,23 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {}sendAnalytics(createRecordingEvent('stop', mode, duration));- if (mode === JitsiRecordingConstants.mode.FILE && !isRecorderTranscriptionsRunning(state)) {- soundOff = RECORDING_OFF_SOUND_ID;- soundOn = RECORDING_ON_SOUND_ID;+ // Check if transcription was enabled when the recording started+ const sessionId = action.sessionData.id;+ const wasWithTranscription = sessionId ? sessionsWithTranscription.get(sessionId) ?? false : false;++ if (mode === JitsiRecordingConstants.mode.FILE) {+ if (wasWithTranscription) {+ soundOff = RECORDING_AND_TRANSCRIPTION_OFF_SOUND_ID;+ soundOn = RECORDING_AND_TRANSCRIPTION_ON_SOUND_ID;+ } else {+ soundOff = RECORDING_OFF_SOUND_ID;+ soundOn = RECORDING_ON_SOUND_ID;+ }++ // Clean up the entry when recording stops+ if (sessionId) {+ sessionsWithTranscription.delete(sessionId);+ }} else if (mode === JitsiRecordingConstants.mode.STREAM) {soundOff = LIVE_STREAMING_OFF_SOUND_ID;soundOn = LIVE_STREAMING_ON_SOUND_ID;diff --git a/react/features/recording/sounds.ts b/react/features/recording/sounds.tsindex 041ea8219a..afa5e30116 100644--- a/react/features/recording/sounds.ts+++ b/react/features/recording/sounds.ts@@ -25,3 +25,31 @@ export const RECORDING_OFF_SOUND_FILE = 'recordingOff.mp3';* @type {string}*/export const RECORDING_ON_SOUND_FILE = 'recordingOn.mp3';++/**+ * The name of the bundled audio file which will be played for when transcription is stopped.+ *+ * @type {string}+ */+export const TRANSCRIPTION_OFF_SOUND_FILE = 'transcriptionOff.mp3';++/**+ * The name of the bundled audio file which will be played for when transcription is started.+ *+ * @type {string}+ */+export const TRANSCRIPTION_ON_SOUND_FILE = 'transcriptionOn.mp3';++/**+ * The name of the bundled audio file which will be played for when recording and transcription are stopped.+ *+ * @type {string}+ */+export const RECORDING_AND_TRANSCRIPTION_OFF_SOUND_FILE = 'recordingAndTranscriptionOff.mp3';++/**+ * The name of the bundled audio file which will be played for when recording and transcription are started.+ *+ * @type {string}+ */+export const RECORDING_AND_TRANSCRIPTION_ON_SOUND_FILE = 'recordingAndTranscriptionOn.mp3';diff --git a/react/features/transcribing/subscriber.ts b/react/features/transcribing/subscriber.tsindex 16728f9c5b..a1438ef490 100644--- a/react/features/transcribing/subscriber.ts+++ b/react/features/transcribing/subscriber.ts@@ -7,7 +7,10 @@ import { playSound } from '../base/sounds/actions';import { showNotification } from '../notifications/actions';import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';import { INotificationProps } from '../notifications/types';-import { RECORDING_OFF_SOUND_ID, RECORDING_ON_SOUND_ID } from '../recording/constants';+import {+ TRANSCRIPTION_OFF_SOUND_ID,+ TRANSCRIPTION_ON_SOUND_ID+} from '../recording/constants';import { isLiveStreamingRunning, isRecordingRunning } from '../recording/functions';import { isRecorderTranscriptionsRunning, isTranscribing } from './functions';@@ -17,7 +20,12 @@ import { isRecorderTranscriptionsRunning, isTranscribing } from './functions';*/StateListenerRegistry.register(/* selector */ isRecorderTranscriptionsRunning,- /* listener */ (isRecorderTranscriptionsRunningValue, { getState, dispatch }) => {+ /* listener */ (isRecorderTranscriptionsRunningValue, { getState, dispatch }, previousValue) => {+ // Only emit notifications on actual changes, not on initial state+ if (previousValue === undefined) {+ return;+ }+if (isRecorderTranscriptionsRunningValue) {maybeEmitRecordingNotification(dispatch, getState, true);} else {@@ -27,7 +35,12 @@ StateListenerRegistry.register();StateListenerRegistry.register(/* selector */ isTranscribing,- /* listener */ (isTranscribingValue, { getState }) => {+ /* listener */ (isTranscribingValue, { getState }, previousValue) => {+ // Only notify on actual changes, not on initial state+ if (previousValue === undefined) {+ return;+ }+if (isTranscribingValue) {notifyTranscribingStatusChanged(getState, true);} else {@@ -56,14 +69,15 @@ function maybeEmitRecordingNotification(dispatch: IStore['dispatch'], getState:return;}+ // Show transcription-specific notification when there's no recordingconst notifyProps: INotificationProps = {- descriptionKey: on ? 'recording.on' : 'recording.off',+ descriptionKey: on ? 'transcribing.on' : 'transcribing.off',titleKey: 'dialog.recording'};batch(() => {dispatch(showNotification(notifyProps, NOTIFICATION_TIMEOUT_TYPE.SHORT));- dispatch(playSound(on ? RECORDING_ON_SOUND_ID : RECORDING_OFF_SOUND_ID));+ dispatch(playSound(on ? TRANSCRIPTION_ON_SOUND_ID : TRANSCRIPTION_OFF_SOUND_ID));});}diff --git a/sounds/recordingAndTranscriptionOff.mp3 b/sounds/recordingAndTranscriptionOff.mp3new file mode 100644index 0000000000..ef6ae39f54Binary files /dev/null and b/sounds/recordingAndTranscriptionOff.mp3 differdiff --git a/sounds/recordingAndTranscriptionOff.opus b/sounds/recordingAndTranscriptionOff.opusnew file mode 100644index 0000000000..6846c271e3Binary files /dev/null and b/sounds/recordingAndTranscriptionOff.opus differdiff --git a/sounds/recordingAndTranscriptionOff_fr.mp3 b/sounds/recordingAndTranscriptionOff_fr.mp3new file mode 100644index 0000000000..73c972c78dBinary files /dev/null and b/sounds/recordingAndTranscriptionOff_fr.mp3 differdiff --git a/sounds/recordingAndTranscriptionOff_fr.opus b/sounds/recordingAndTranscriptionOff_fr.opusnew file mode 100644index 0000000000..a97fd6500bBinary files /dev/null and b/sounds/recordingAndTranscriptionOff_fr.opus differdiff --git a/sounds/recordingAndTranscriptionOff_frCA.mp3 b/sounds/recordingAndTranscriptionOff_frCA.mp3new file mode 100644index 0000000000..4d86dca70aBinary files /dev/null and b/sounds/recordingAndTranscriptionOff_frCA.mp3 differdiff --git a/sounds/recordingAndTranscriptionOff_frCA.opus b/sounds/recordingAndTranscriptionOff_frCA.opusnew file mode 100644index 0000000000..441c44dcc1Binary files /dev/null and b/sounds/recordingAndTranscriptionOff_frCA.opus differdiff --git a/sounds/recordingAndTranscriptionOn.mp3 b/sounds/recordingAndTranscriptionOn.mp3new file mode 100644index 0000000000..b8ce661ad4Binary files /dev/null and b/sounds/recordingAndTranscriptionOn.mp3 differdiff --git a/sounds/recordingAndTranscriptionOn.opus b/sounds/recordingAndTranscriptionOn.opusnew file mode 100644index 0000000000..06172be721Binary files /dev/null and b/sounds/recordingAndTranscriptionOn.opus differdiff --git a/sounds/recordingAndTranscriptionOn_fr.mp3 b/sounds/recordingAndTranscriptionOn_fr.mp3new file mode 100644index 0000000000..759e5bc14dBinary files /dev/null and b/sounds/recordingAndTranscriptionOn_fr.mp3 differdiff --git a/sounds/recordingAndTranscriptionOn_fr.opus b/sounds/recordingAndTranscriptionOn_fr.opusnew file mode 100644index 0000000000..c242324357Binary files /dev/null and b/sounds/recordingAndTranscriptionOn_fr.opus differdiff --git a/sounds/recordingAndTranscriptionOn_frCA.mp3 b/sounds/recordingAndTranscriptionOn_frCA.mp3new file mode 100644index 0000000000..cae4976faeBinary files /dev/null and b/sounds/recordingAndTranscriptionOn_frCA.mp3 differdiff --git a/sounds/recordingAndTranscriptionOn_frCA.opus b/sounds/recordingAndTranscriptionOn_frCA.opusnew file mode 100644index 0000000000..c8f897f694Binary files /dev/null and b/sounds/recordingAndTranscriptionOn_frCA.opus differdiff --git a/sounds/recordingOff.mp3 b/sounds/recordingOff.mp3index 3c89861824..66fee196e2 100644Binary files a/sounds/recordingOff.mp3 and b/sounds/recordingOff.mp3 differdiff --git a/sounds/recordingOff.opus b/sounds/recordingOff.opusindex 1dad098d72..1a3a1cb0a7 100644Binary files a/sounds/recordingOff.opus and b/sounds/recordingOff.opus differdiff --git a/sounds/recordingOff_fr.mp3 b/sounds/recordingOff_fr.mp3index f36a379ff7..5dd529d9f3 100644Binary files a/sounds/recordingOff_fr.mp3 and b/sounds/recordingOff_fr.mp3 differdiff --git a/sounds/recordingOff_fr.opus b/sounds/recordingOff_fr.opusindex fb4b0424aa..71a53315a0 100644Binary files a/sounds/recordingOff_fr.opus and b/sounds/recordingOff_fr.opus differdiff --git a/sounds/recordingOff_frCA.mp3 b/sounds/recordingOff_frCA.mp3index f36a379ff7..7ffb9a5350 100644Binary files a/sounds/recordingOff_frCA.mp3 and b/sounds/recordingOff_frCA.mp3 differdiff --git a/sounds/recordingOff_frCA.opus b/sounds/recordingOff_frCA.opusindex fb4b0424aa..e51e0fbb76 100644Binary files a/sounds/recordingOff_frCA.opus and b/sounds/recordingOff_frCA.opus differdiff --git a/sounds/recordingOn.mp3 b/sounds/recordingOn.mp3index e8b9e85995..ed0979bd5e 100644Binary files a/sounds/recordingOn.mp3 and b/sounds/recordingOn.mp3 differdiff --git a/sounds/recordingOn.opus b/sounds/recordingOn.opusindex f02bde895b..8418a726fc 100644Binary files a/sounds/recordingOn.opus and b/sounds/recordingOn.opus differdiff --git a/sounds/recordingOn_fr.mp3 b/sounds/recordingOn_fr.mp3index 35c6568d7d..1b41e779e2 100644Binary files a/sounds/recordingOn_fr.mp3 and b/sounds/recordingOn_fr.mp3 differdiff --git a/sounds/recordingOn_fr.opus b/sounds/recordingOn_fr.opusindex f1c64c74da..bbc1d7331d 100644Binary files a/sounds/recordingOn_fr.opus and b/sounds/recordingOn_fr.opus differdiff --git a/sounds/recordingOn_frCA.mp3 b/sounds/recordingOn_frCA.mp3index 35c6568d7d..15c0bfd2b7 100644Binary files a/sounds/recordingOn_frCA.mp3 and b/sounds/recordingOn_frCA.mp3 differdiff --git a/sounds/recordingOn_frCA.opus b/sounds/recordingOn_frCA.opusindex f1c64c74da..e3818f13e9 100644Binary files a/sounds/recordingOn_frCA.opus and b/sounds/recordingOn_frCA.opus differdiff --git a/sounds/transcriptionOff.mp3 b/sounds/transcriptionOff.mp3new file mode 100644index 0000000000..9a5c921f2fBinary files /dev/null and b/sounds/transcriptionOff.mp3 differdiff --git a/sounds/transcriptionOff.opus b/sounds/transcriptionOff.opusnew file mode 100644index 0000000000..049bc01e25Binary files /dev/null and b/sounds/transcriptionOff.opus differdiff --git a/sounds/transcriptionOff_fr.mp3 b/sounds/transcriptionOff_fr.mp3new file mode 100644index 0000000000..db1c63c15dBinary files /dev/null and b/sounds/transcriptionOff_fr.mp3 differdiff --git a/sounds/transcriptionOff_fr.opus b/sounds/transcriptionOff_fr.opusnew file mode 100644index 0000000000..692ac7b0ceBinary files /dev/null and b/sounds/transcriptionOff_fr.opus differdiff --git a/sounds/transcriptionOff_frCA.mp3 b/sounds/transcriptionOff_frCA.mp3new file mode 100644index 0000000000..a7907b0ac8Binary files /dev/null and b/sounds/transcriptionOff_frCA.mp3 differdiff --git a/sounds/transcriptionOff_frCA.opus b/sounds/transcriptionOff_frCA.opusnew file mode 100644index 0000000000..1149d78d68Binary files /dev/null and b/sounds/transcriptionOff_frCA.opus differdiff --git a/sounds/transcriptionOn.mp3 b/sounds/transcriptionOn.mp3new file mode 100644index 0000000000..70e81732e0Binary files /dev/null and b/sounds/transcriptionOn.mp3 differdiff --git a/sounds/transcriptionOn.opus b/sounds/transcriptionOn.opusnew file mode 100644index 0000000000..db1007223dBinary files /dev/null and b/sounds/transcriptionOn.opus differdiff --git a/sounds/transcriptionOn_fr.mp3 b/sounds/transcriptionOn_fr.mp3new file mode 100644index 0000000000..f6fdcb21a4Binary files /dev/null and b/sounds/transcriptionOn_fr.mp3 differdiff --git a/sounds/transcriptionOn_fr.opus b/sounds/transcriptionOn_fr.opusnew file mode 100644index 0000000000..82d64ecc09Binary files /dev/null and b/sounds/transcriptionOn_fr.opus differdiff --git a/sounds/transcriptionOn_frCA.mp3 b/sounds/transcriptionOn_frCA.mp3new file mode 100644index 0000000000..7a9408fa3fBinary files /dev/null and b/sounds/transcriptionOn_frCA.mp3 differdiff --git a/sounds/transcriptionOn_frCA.opus b/sounds/transcriptionOn_frCA.opusnew file mode 100644index 0000000000..a9348960baBinary files /dev/null and b/sounds/transcriptionOn_frCA.opus differ