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(recordings) send recordings metadata
Avram Tudore73c3b6697a5
diff --git a/react/features/base/conference/actionTypes.ts b/react/features/base/conference/actionTypes.tsindex adabbab60f..0557717c47 100644--- a/react/features/base/conference/actionTypes.ts+++ b/react/features/base/conference/actionTypes.ts@@ -345,3 +345,13 @@ export const SET_START_MUTED_POLICY = 'SET_START_MUTED_POLICY';* }*/export const SET_ASSUMED_BANDWIDTH_BPS = 'SET_ASSUMED_BANDWIDTH_BPS';++/**+ * The type of (redux) action which updated the conference metadata.+ *+ * {+ * type: UPDATE_CONFERENCE_METADATA,+ * metadata: Object+ * }+ */+export const UPDATE_CONFERENCE_METADATA = 'UPDATE_CONFERENCE_METADATA';diff --git a/react/features/base/conference/actions.ts b/react/features/base/conference/actions.tsindex 78c026f351..67c809c609 100644--- a/react/features/base/conference/actions.ts+++ b/react/features/base/conference/actions.ts@@ -61,7 +61,8 @@ import {SET_PENDING_SUBJECT_CHANGE,SET_ROOM,SET_START_MUTED_POLICY,- SET_START_REACTIONS_MUTED+ SET_START_REACTIONS_MUTED,+ UPDATE_CONFERENCE_METADATA} from './actionTypes';import {AVATAR_URL_COMMAND,@@ -79,7 +80,7 @@ import {sendLocalParticipant} from './functions';import logger from './logger';-import { IJitsiConference } from './reducer';+import { IConferenceMetadata, IJitsiConference } from './reducer';/*** Adds conference (event) listeners.@@ -275,6 +276,21 @@ function _addConferenceListeners(conference: IJitsiConference, dispatch: IStore[})));}+/**+ * Action for updating the conference metadata.+ *+ * @param {IConferenceMetadata} metadata - The metadata object.+ * @returns {{+ * type: UPDATE_CONFERENCE_METADATA,+ * metadata: IConferenceMetadata+ * }}+ */+export function updateConferenceMetadata(metadata: IConferenceMetadata | null) {+ return {+ type: UPDATE_CONFERENCE_METADATA,+ metadata+ };+}/*** Create an action for when the end-to-end RTT against a specific remote participant has changed.diff --git a/react/features/base/conference/middleware.any.ts b/react/features/base/conference/middleware.any.tsindex 10ee3b8604..db85bc6b36 100644--- a/react/features/base/conference/middleware.any.ts+++ b/react/features/base/conference/middleware.any.ts@@ -26,7 +26,7 @@ import { overwriteConfig } from '../config/actions';import { CONNECTION_ESTABLISHED, CONNECTION_FAILED } from '../connection/actionTypes';import { connect, connectionDisconnected, disconnect } from '../connection/actions';import { validateJwt } from '../jwt/functions';-import { JitsiConferenceErrors, JitsiConnectionErrors } from '../lib-jitsi-meet';+import { JitsiConferenceErrors, JitsiConferenceEvents, JitsiConnectionErrors } from '../lib-jitsi-meet';import { PARTICIPANT_UPDATED, PIN_PARTICIPANT } from '../participants/actionTypes';import { PARTICIPANT_ROLE } from '../participants/constants';import {@@ -35,6 +35,7 @@ import {getPinnedParticipant} from '../participants/functions';import MiddlewareRegistry from '../redux/MiddlewareRegistry';+import StateListenerRegistry from '../redux/StateListenerRegistry';import { TRACK_ADDED, TRACK_REMOVED } from '../tracks/actionTypes';import { getLocalTracks } from '../tracks/functions.any';@@ -55,7 +56,8 @@ import {conferenceWillLeave,createConference,setLocalSubject,- setSubject+ setSubject,+ updateConferenceMetadata} from './actions';import { CONFERENCE_LEAVE_REASONS } from './constants';import {@@ -66,6 +68,7 @@ import {restoreConferenceOptions} from './functions';import logger from './logger';+import { IConferenceMetadata } from './reducer';/*** Handler for before unload event.@@ -125,6 +128,24 @@ MiddlewareRegistry.register(store => next => action => {return next(action);});+/**+ * Set up state change listener to perform maintenance tasks when the conference+ * is left or failed.+ */+StateListenerRegistry.register(+ state => getCurrentConference(state),+ (conference, { dispatch }, previousConference): void => {+ if (conference && !previousConference) {+ conference.on(JitsiConferenceEvents.METADATA_UPDATED, (metadata: IConferenceMetadata) => {+ dispatch(updateConferenceMetadata(metadata));+ });+ }++ if (conference !== previousConference) {+ dispatch(updateConferenceMetadata(null));+ }+ });+/*** Makes sure to leave a failed conference in order to release any allocated* resources like peer connections, emit participant left events, etc.diff --git a/react/features/base/conference/reducer.ts b/react/features/base/conference/reducer.tsindex 6cbdbf1ffc..d939bfab5d 100644--- a/react/features/base/conference/reducer.ts+++ b/react/features/base/conference/reducer.ts@@ -27,7 +27,8 @@ import {SET_PENDING_SUBJECT_CHANGE,SET_ROOM,SET_START_MUTED_POLICY,- SET_START_REACTIONS_MUTED+ SET_START_REACTIONS_MUTED,+ UPDATE_CONFERENCE_METADATA} from './actionTypes';import { isRoomValid } from './functions';@@ -39,10 +40,23 @@ const DEFAULT_STATE = {leaving: undefined,locked: undefined,membersOnly: undefined,+ metadata: undefined,password: undefined,passwordRequired: undefined};+export interface IConferenceMetadata {+ recording?: {+ isTranscribingEnabled: boolean;+ };+ whiteboard?: {+ collabDetails: {+ roomId: string;+ roomKey: string;+ };+ };+}+export interface IJitsiConference {addCommandListener: Function;addLobbyMessageListener: Function;@@ -141,6 +155,7 @@ export interface IConferenceState {localSubject?: string;locked?: string;membersOnly?: IJitsiConference;+ metadata?: IConferenceMetadata;obfuscatedRoom?: string;obfuscatedRoomSource?: string;p2p?: Object;@@ -247,6 +262,12 @@ ReducerRegistry.register<IConferenceState>('features/base/conference',startAudioMutedPolicy: action.startAudioMutedPolicy,startVideoMutedPolicy: action.startVideoMutedPolicy};++ case UPDATE_CONFERENCE_METADATA:+ return {+ ...state,+ metadata: action.metadata+ };}return state;diff --git a/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts b/react/features/recording/components/Recording/AbstractStartRecordingDialog.tsindex d944228d48..7d49c5c27e 100644--- a/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts+++ b/react/features/recording/components/Recording/AbstractStartRecordingDialog.ts@@ -12,7 +12,7 @@ import { showErrorNotification } from '../../../notifications/actions';import { NOTIFICATION_TIMEOUT_TYPE } from '../../../notifications/constants';import { setRequestingSubtitles } from '../../../subtitles/actions.any';import { setSelectedRecordingService, startLocalVideoRecording } from '../../actions';-import { RECORDING_TYPES } from '../../constants';+import { RECORDING_METADATA_ID, RECORDING_TYPES } from '../../constants';import { isRecordingSharingEnabled, shouldAutoTranscribeOnRecord, supportsLocalRecording } from '../../functions';export interface IProps extends WithTranslation {@@ -401,6 +401,10 @@ class AbstractStartRecordingDialog extends Component<IProps, IState> {dispatch(setRequestingSubtitles(true, false, null));}+ _conference?.getMetadataHandler().setMetadata(RECORDING_METADATA_ID, {+ isTranscribingEnabled: this.state.shouldRecordTranscription+ });+return true;}diff --git a/react/features/recording/constants.ts b/react/features/recording/constants.tsindex 8384bd559e..942256e31c 100644--- a/react/features/recording/constants.ts+++ b/react/features/recording/constants.ts@@ -60,3 +60,5 @@ export const RECORDING_STATUS_PRIORITIES = [];export const START_RECORDING_NOTIFICATION_ID = 'START_RECORDING_NOTIFICATION_ID';++export const RECORDING_METADATA_ID = 'recording';diff --git a/react/features/whiteboard/middleware.any.ts b/react/features/whiteboard/middleware.any.tsindex b6d538728c..5cdd0c021a 100644--- a/react/features/whiteboard/middleware.any.ts+++ b/react/features/whiteboard/middleware.any.ts@@ -1,8 +1,8 @@import { createOpenWhiteboardEvent } from '../analytics/AnalyticsEvents';import { sendAnalytics } from '../analytics/functions';import { IStore } from '../app/types';+import { UPDATE_CONFERENCE_METADATA } from '../base/conference/actionTypes';import { getCurrentConference } from '../base/conference/functions';-import { JitsiConferenceEvents } from '../base/lib-jitsi-meet';import MiddlewareRegistry from '../base/redux/MiddlewareRegistry';import StateListenerRegistry from '../base/redux/StateListenerRegistry';@@ -37,6 +37,19 @@ MiddlewareRegistry.register((store: IStore) => next => action => {break;}++ case UPDATE_CONFERENCE_METADATA: {+ const { metadata } = action;++ if (metadata[WHITEBOARD_ID]) {+ store.dispatch(setupWhiteboard({+ collabDetails: metadata[WHITEBOARD_ID].collabDetails+ }));+ store.dispatch(setWhiteboardOpen(true));+ }++ break;+ }}return next(action);@@ -52,16 +65,6 @@ StateListenerRegistry.register(if (conference !== previousConference) {dispatch(resetWhiteboard());}- if (conference && !previousConference) {- conference.on(JitsiConferenceEvents.METADATA_UPDATED, (metadata: any) => {- if (metadata[WHITEBOARD_ID]) {- dispatch(setupWhiteboard({- collabDetails: metadata[WHITEBOARD_ID].collabDetails- }));- dispatch(setWhiteboardOpen(true));- }- });- }});/**