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.js 1.6KB

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