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.any.js 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // @flow
  2. import {
  3. SET_FILMSTRIP_ENABLED,
  4. SET_FILMSTRIP_VISIBLE,
  5. SET_REMOTE_PARTICIPANTS,
  6. SET_VISIBLE_REMOTE_PARTICIPANTS
  7. } from './actionTypes';
  8. /**
  9. * Sets whether the filmstrip is enabled.
  10. *
  11. * @param {boolean} enabled - Whether the filmstrip is enabled.
  12. * @returns {{
  13. * type: SET_FILMSTRIP_ENABLED,
  14. * enabled: boolean
  15. * }}
  16. */
  17. export function setFilmstripEnabled(enabled: boolean) {
  18. return {
  19. type: SET_FILMSTRIP_ENABLED,
  20. enabled
  21. };
  22. }
  23. /**
  24. * Sets whether the filmstrip is visible.
  25. *
  26. * @param {boolean} visible - Whether the filmstrip is visible.
  27. * @returns {{
  28. * type: SET_FILMSTRIP_VISIBLE,
  29. * visible: boolean
  30. * }}
  31. */
  32. export function setFilmstripVisible(visible: boolean) {
  33. return {
  34. type: SET_FILMSTRIP_VISIBLE,
  35. visible
  36. };
  37. }
  38. /**
  39. * Sets the list of the reordered remote participants based on which the visible participants in the filmstrip will be
  40. * determined.
  41. *
  42. * @param {Array<string>} participants - The list of the remote participant endpoint IDs.
  43. * @returns {{
  44. type: SET_REMOTE_PARTICIPANTS,
  45. participants: Array<string>
  46. }}
  47. */
  48. export function setRemoteParticipants(participants: Array<string>) {
  49. return {
  50. type: SET_REMOTE_PARTICIPANTS,
  51. participants
  52. };
  53. }
  54. /**
  55. * Sets the list of the visible participants in the filmstrip by storing the start and end index from the remote
  56. * participants array.
  57. *
  58. * @param {number} startIndex - The start index from the remote participants array.
  59. * @param {number} endIndex - The end index from the remote participants array.
  60. * @returns {{
  61. * type: SET_VISIBLE_REMOTE_PARTICIPANTS,
  62. * startIndex: number,
  63. * endIndex: number
  64. * }}
  65. */
  66. export function setVisibleRemoteParticipants(startIndex: number, endIndex: number) {
  67. return {
  68. type: SET_VISIBLE_REMOTE_PARTICIPANTS,
  69. startIndex,
  70. endIndex
  71. };
  72. }