You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

actions.native.ts 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import { IStore } from '../app/types';
  2. import { openSheet } from '../base/dialog/actions';
  3. import JitsiMeetJS from '../base/lib-jitsi-meet';
  4. import { showNotification } from '../notifications/actions';
  5. import { NOTIFICATION_TIMEOUT_TYPE } from '../notifications/constants';
  6. // @ts-ignore
  7. import HighlightDialog from './components/Recording/native/HighlightDialog';
  8. export * from './actions.any';
  9. /**
  10. * Opens the highlight dialog.
  11. *
  12. * @returns {Function}
  13. */
  14. export function openHighlightDialog() {
  15. return (dispatch: IStore['dispatch']) => {
  16. dispatch(openSheet(HighlightDialog));
  17. };
  18. }
  19. /**
  20. * Signals that a started recording notification should be shown on the
  21. * screen for a given period.
  22. *
  23. * @param {string} streamType - The type of the stream ({@code file} or
  24. * {@code stream}).
  25. * @returns {showNotification}
  26. */
  27. export function showRecordingLimitNotification(streamType: string) {
  28. return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
  29. const isLiveStreaming = streamType === JitsiMeetJS.constants.recording.mode.STREAM;
  30. let descriptionKey, titleKey;
  31. if (isLiveStreaming) {
  32. descriptionKey = 'liveStreaming.limitNotificationDescriptionNative';
  33. titleKey = 'dialog.liveStreaming';
  34. } else {
  35. descriptionKey = 'recording.limitNotificationDescriptionNative';
  36. titleKey = 'dialog.recording';
  37. }
  38. const { recordingLimit = {} } = getState()['features/base/config'];
  39. const { limit, appName } = recordingLimit;
  40. return dispatch(showNotification({
  41. descriptionArguments: {
  42. limit,
  43. app: appName
  44. },
  45. descriptionKey,
  46. titleKey,
  47. maxLines: 2
  48. }, NOTIFICATION_TIMEOUT_TYPE.LONG));
  49. };
  50. }