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

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