2022-11-11 08:20:33 +00:00
|
|
|
import { IStore } from '../app/types';
|
|
|
|
import { openSheet } from '../base/dialog/actions';
|
2020-05-28 22:42:02 +00:00
|
|
|
import JitsiMeetJS from '../base/lib-jitsi-meet';
|
2022-11-11 08:20:33 +00:00
|
|
|
import { showNotification } from '../notifications/actions';
|
|
|
|
import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
|
2020-05-28 22:42:02 +00:00
|
|
|
|
2022-11-11 08:20:33 +00:00
|
|
|
// @ts-ignore
|
2022-03-18 14:16:56 +00:00
|
|
|
import HighlightDialog from './components/Recording/native/HighlightDialog';
|
|
|
|
|
2020-05-28 22:42:02 +00:00
|
|
|
export * from './actions.any';
|
|
|
|
|
2022-03-18 14:16:56 +00:00
|
|
|
/**
|
|
|
|
* Opens the highlight dialog.
|
|
|
|
*
|
|
|
|
* @returns {Function}
|
|
|
|
*/
|
|
|
|
export function openHighlightDialog() {
|
2022-11-11 08:20:33 +00:00
|
|
|
return (dispatch: IStore['dispatch']) => {
|
2022-06-20 14:53:19 +00:00
|
|
|
dispatch(openSheet(HighlightDialog));
|
2022-03-18 14:16:56 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-05-28 22:42:02 +00:00
|
|
|
/**
|
|
|
|
* Signals that a started recording notification should be shown on the
|
|
|
|
* screen for a given period.
|
|
|
|
*
|
|
|
|
* @param {string} streamType - The type of the stream ({@code file} or
|
|
|
|
* {@code stream}).
|
|
|
|
* @returns {showNotification}
|
|
|
|
*/
|
|
|
|
export function showRecordingLimitNotification(streamType: string) {
|
2022-11-11 08:20:33 +00:00
|
|
|
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
|
2020-05-28 22:42:02 +00:00
|
|
|
const isLiveStreaming = streamType === JitsiMeetJS.constants.recording.mode.STREAM;
|
|
|
|
let descriptionKey, titleKey;
|
|
|
|
|
|
|
|
if (isLiveStreaming) {
|
|
|
|
descriptionKey = 'liveStreaming.limitNotificationDescriptionNative';
|
|
|
|
titleKey = 'dialog.liveStreaming';
|
|
|
|
} else {
|
|
|
|
descriptionKey = 'recording.limitNotificationDescriptionNative';
|
|
|
|
titleKey = 'dialog.recording';
|
|
|
|
}
|
|
|
|
|
|
|
|
const { recordingLimit = {} } = getState()['features/base/config'];
|
|
|
|
const { limit, appName } = recordingLimit;
|
|
|
|
|
|
|
|
return dispatch(showNotification({
|
|
|
|
descriptionArguments: {
|
|
|
|
limit,
|
|
|
|
app: appName
|
|
|
|
},
|
|
|
|
descriptionKey,
|
|
|
|
titleKey,
|
|
|
|
maxLines: 2
|
2021-11-24 11:05:27 +00:00
|
|
|
}, NOTIFICATION_TIMEOUT_TYPE.LONG));
|
2020-05-28 22:42:02 +00:00
|
|
|
};
|
|
|
|
}
|