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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. import {
  2. HIDE_RECORDING_LABEL,
  3. RECORDING_STATE_UPDATED,
  4. SET_RECORDING_TYPE,
  5. TOGGLE_RECORDING
  6. } from './actionTypes';
  7. /**
  8. * Hides any displayed recording label, regardless of current recording state.
  9. *
  10. * @returns {{
  11. * type: HIDE_RECORDING_LABEL
  12. * }}
  13. */
  14. export function hideRecordingLabel() {
  15. return {
  16. type: HIDE_RECORDING_LABEL
  17. };
  18. }
  19. /**
  20. * Sets what type of recording service will be used.
  21. *
  22. * @param {string} recordingType - The type of recording service to be used.
  23. * Should be one of the enumerated types in {@link RECORDING_TYPES}.
  24. * @returns {{
  25. * type: SET_RECORDING_TYPE,
  26. * recordingType: string
  27. * }}
  28. */
  29. export function setRecordingType(recordingType) {
  30. return {
  31. type: SET_RECORDING_TYPE,
  32. recordingType
  33. };
  34. }
  35. /**
  36. * Start or stop recording.
  37. *
  38. * @returns {{
  39. * type: TOGGLE_RECORDING
  40. * }}
  41. */
  42. export function toggleRecording() {
  43. return {
  44. type: TOGGLE_RECORDING
  45. };
  46. }
  47. /**
  48. * Updates the redux state for the recording feature.
  49. *
  50. * @param {Object} recordingState - The new state to merge with the existing
  51. * state in redux.
  52. * @returns {{
  53. * type: RECORDING_STATE_UPDATED,
  54. * recordingState: Object
  55. * }}
  56. */
  57. export function updateRecordingState(recordingState = {}) {
  58. return {
  59. type: RECORDING_STATE_UPDATED,
  60. recordingState
  61. };
  62. }