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

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