"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7309/react/features/base/media/middleware.web.ts" (31 May 2023, 1713 Bytes) of package /linux/misc/jitsi-meet-7309.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "middleware.web.ts": jitsi-meet_8319_vs_jitsi-meet_8615.

    1 import './middleware.any';
    2 import { AnyAction } from 'redux';
    3 
    4 import { IStore } from '../../app/types';
    5 import { showNotification } from '../../notifications/actions';
    6 import { NOTIFICATION_TIMEOUT_TYPE } from '../../notifications/constants';
    7 import LocalRecordingManager from '../../recording/components/Recording/LocalRecordingManager.web';
    8 import StopRecordingDialog from '../../recording/components/Recording/web/StopRecordingDialog';
    9 import { openDialog } from '../dialog/actions';
   10 import MiddlewareRegistry from '../redux/MiddlewareRegistry';
   11 
   12 import { SET_VIDEO_MUTED } from './actionTypes';
   13 
   14 import './subscriber';
   15 
   16 /**
   17  * Implements the entry point of the middleware of the feature base/media.
   18  *
   19  * @param {IStore} store - The redux store.
   20  * @returns {Function}
   21  */
   22 MiddlewareRegistry.register((store: IStore) => (next: Function) => (action: AnyAction) => {
   23     const { dispatch } = store;
   24 
   25     switch (action.type) {
   26     case SET_VIDEO_MUTED: {
   27         if (LocalRecordingManager.isRecordingLocally() && LocalRecordingManager.selfRecording.on) {
   28             if (action.muted && LocalRecordingManager.selfRecording.withVideo) {
   29                 dispatch(openDialog(StopRecordingDialog, { localRecordingVideoStop: true }));
   30 
   31                 return;
   32             } else if (!action.muted && !LocalRecordingManager.selfRecording.withVideo) {
   33                 dispatch(showNotification({
   34                     titleKey: 'recording.localRecordingNoVideo',
   35                     descriptionKey: 'recording.localRecordingVideoWarning',
   36                     uid: 'recording.localRecordingNoVideo'
   37                 }, NOTIFICATION_TIMEOUT_TYPE.MEDIUM));
   38             }
   39         }
   40     }
   41     }
   42 
   43     return next(action);
   44 });