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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* @flow */
  2. import {
  3. LOCAL_RECORDING_ENGAGED,
  4. LOCAL_RECORDING_UNENGAGED,
  5. LOCAL_RECORDING_TOGGLE_DIALOG,
  6. LOCAL_RECORDING_STATS_UPDATE
  7. } from './actionTypes';
  8. // The following two actions signal state changes in local recording engagement.
  9. // In other words, the events of the local WebWorker / MediaRecorder starting to
  10. // record and finishing recording.
  11. // Note that this is not the event fired when the users tries to start the
  12. // recording in the UI.
  13. /**
  14. * Signals that local recording has started.
  15. *
  16. * @returns {{
  17. * type: LOCAL_RECORDING_ENGAGED
  18. * }}
  19. */
  20. export function localRecordingEngaged() {
  21. return {
  22. type: LOCAL_RECORDING_ENGAGED
  23. };
  24. }
  25. /**
  26. * Signals that local recording has finished.
  27. *
  28. * @returns {{
  29. * type: LOCAL_RECORDING_UNENGAGED
  30. * }}
  31. */
  32. export function localRecordingUnengaged() {
  33. return {
  34. type: LOCAL_RECORDING_UNENGAGED
  35. };
  36. }
  37. /**
  38. * Toggles the open/close state of {@code LocalRecordingInfoDialog}.
  39. *
  40. * @returns {{
  41. * type: LOCAL_RECORDING_TOGGLE_DIALOG
  42. * }}
  43. */
  44. export function toggleLocalRecordingInfoDialog() {
  45. return {
  46. type: LOCAL_RECORDING_TOGGLE_DIALOG
  47. };
  48. }
  49. /**
  50. * Updates the the local recording stats from each client,
  51. * to be displayed on {@code LocalRecordingInfoDialog}.
  52. *
  53. * @param {*} stats - The stats object.
  54. * @returns {{
  55. * type: LOCAL_RECORDING_STATS_UPDATE,
  56. * stats: Object
  57. * }}
  58. */
  59. export function statsUpdate(stats: Object) {
  60. return {
  61. type: LOCAL_RECORDING_STATS_UPDATE,
  62. stats
  63. };
  64. }