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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 been engaged.
  15. *
  16. * @param {Date} startTime - Time when the recording is engaged.
  17. * @returns {{
  18. * type: LOCAL_RECORDING_ENGAGED,
  19. * recordingEngagedAt: Date
  20. * }}
  21. */
  22. export function localRecordingEngaged(startTime: Date) {
  23. return {
  24. type: LOCAL_RECORDING_ENGAGED,
  25. recordingEngagedAt: startTime
  26. };
  27. }
  28. /**
  29. * Signals that local recording has finished.
  30. *
  31. * @returns {{
  32. * type: LOCAL_RECORDING_UNENGAGED
  33. * }}
  34. */
  35. export function localRecordingUnengaged() {
  36. return {
  37. type: LOCAL_RECORDING_UNENGAGED
  38. };
  39. }
  40. /**
  41. * Toggles the open/close state of {@code LocalRecordingInfoDialog}.
  42. *
  43. * @returns {{
  44. * type: LOCAL_RECORDING_TOGGLE_DIALOG
  45. * }}
  46. */
  47. export function toggleLocalRecordingInfoDialog() {
  48. return {
  49. type: LOCAL_RECORDING_TOGGLE_DIALOG
  50. };
  51. }
  52. /**
  53. * Updates the the local recording stats from each client,
  54. * to be displayed on {@code LocalRecordingInfoDialog}.
  55. *
  56. * @param {*} stats - The stats object.
  57. * @returns {{
  58. * type: LOCAL_RECORDING_STATS_UPDATE,
  59. * stats: Object
  60. * }}
  61. */
  62. export function statsUpdate(stats: Object) {
  63. return {
  64. type: LOCAL_RECORDING_STATS_UPDATE,
  65. stats
  66. };
  67. }