mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
ref: add selector for checking cloud recording running status
This commit is contained in:
@@ -7,7 +7,7 @@ import { isLocalParticipantModerator } from '../../../base/participants/function
|
||||
import AbstractButton, { IProps as AbstractButtonProps } from '../../../base/toolbox/components/AbstractButton';
|
||||
import { isInBreakoutRoom } from '../../../breakout-rooms/functions';
|
||||
import { maybeShowPremiumFeatureDialog } from '../../../jaas/actions';
|
||||
import { getActiveSession } from '../../functions';
|
||||
import { getActiveSession, isCloudRecordingRunning } from '../../functions';
|
||||
|
||||
import { getLiveStreaming } from './functions';
|
||||
|
||||
@@ -140,7 +140,7 @@ export function _mapStateToProps(state: IReduxState, ownProps: IProps) {
|
||||
}
|
||||
|
||||
// disable the button if the recording is running.
|
||||
if (visible && getActiveSession(state, JitsiRecordingConstants.mode.FILE)) {
|
||||
if (visible && isCloudRecordingRunning(state)) {
|
||||
_disabled = true;
|
||||
_tooltip = 'dialog.liveStreamingDisabledBecauseOfActiveRecordingTooltip';
|
||||
}
|
||||
|
||||
@@ -4,14 +4,17 @@ import { WithTranslation } from 'react-i18next';
|
||||
import { IReduxState, IStore } from '../../../app/types';
|
||||
import { openDialog } from '../../../base/dialog/actions';
|
||||
import { MEET_FEATURES } from '../../../base/jwt/constants';
|
||||
import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
|
||||
import { maybeShowPremiumFeatureDialog } from '../../../jaas/actions';
|
||||
import { hideNotification, showNotification } from '../../../notifications/actions';
|
||||
import { NOTIFICATION_TIMEOUT_TYPE, NOTIFICATION_TYPE } from '../../../notifications/constants';
|
||||
import { iAmVisitor } from '../../../visitors/functions';
|
||||
import { highlightMeetingMoment } from '../../actions.any';
|
||||
import { PROMPT_RECORDING_NOTIFICATION_ID } from '../../constants';
|
||||
import { getActiveSession, getRecordButtonProps, isHighlightMeetingMomentDisabled } from '../../functions';
|
||||
import {
|
||||
getRecordButtonProps,
|
||||
isCloudRecordingRunning,
|
||||
isHighlightMeetingMomentDisabled
|
||||
} from '../../functions';
|
||||
|
||||
import { StartRecordingDialog } from './index';
|
||||
|
||||
@@ -103,7 +106,7 @@ export default class AbstractHighlightButton<P extends IProps, S={}> extends Com
|
||||
* }}
|
||||
*/
|
||||
export function _abstractMapStateToProps(state: IReduxState) {
|
||||
const isRecordingRunning = getActiveSession(state, JitsiRecordingConstants.mode.FILE);
|
||||
const isRecordingRunning = isCloudRecordingRunning(state);
|
||||
const isButtonDisabled = isHighlightMeetingMomentDisabled(state);
|
||||
const { webhookProxyUrl } = state['features/base/config'];
|
||||
const _iAmVisitor = iAmVisitor(state);
|
||||
|
||||
@@ -158,6 +158,16 @@ export function supportsLocalRecording() {
|
||||
&& navigator.product !== 'ReactNative';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if there is a cloud recording running.
|
||||
*
|
||||
* @param {IReduxState} state - The redux state to search in.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function isCloudRecordingRunning(state: IReduxState) {
|
||||
return Boolean(getActiveSession(state, JitsiRecordingConstants.mode.FILE));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if there is a recording session running.
|
||||
*
|
||||
@@ -168,7 +178,7 @@ export function isRecordingRunning(state: IReduxState) {
|
||||
const { isTranscribing } = state['features/transcribing'];
|
||||
|
||||
return (
|
||||
Boolean(getActiveSession(state, JitsiRecordingConstants.mode.FILE))
|
||||
isCloudRecordingRunning(state)
|
||||
|| LocalRecordingManager.isRecordingLocally()
|
||||
|| isTranscribing
|
||||
);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { IReduxState } from '../app/types';
|
||||
import { IStateful } from '../base/app/types';
|
||||
import { JitsiRecordingConstants } from '../base/lib-jitsi-meet';
|
||||
import { toState } from '../base/redux/functions';
|
||||
import { getActiveSession } from '../recording/functions';
|
||||
import { isCloudRecordingRunning } from '../recording/functions';
|
||||
import { isScreenVideoShared } from '../screen-share/functions';
|
||||
|
||||
import ScreenshotCaptureSummary from './ScreenshotCaptureSummary';
|
||||
@@ -48,7 +47,7 @@ export function isScreenshotCaptureEnabled(state: IReduxState, checkSharing?: bo
|
||||
}
|
||||
|
||||
// Feature enabled only when recording is also on.
|
||||
return Boolean(getActiveSession(state, JitsiRecordingConstants.mode.FILE));
|
||||
return isCloudRecordingRunning(state);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user