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

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