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 2.4KB

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