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.native.js 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // @flow
  2. import { openDialog } from '../base/dialog';
  3. import { SET_SHARED_VIDEO_STATUS, TOGGLE_SHARED_VIDEO } from './actionTypes';
  4. import { SharedVideoDialog } from './components/native';
  5. /**
  6. * Updates the current known status of the shared video.
  7. *
  8. * @param {string} videoId - The id of the video to be shared.
  9. * @param {string} status - The current status of the video being shared.
  10. * @param {number} time - The current position of the video being shared.
  11. * @param {string} ownerId - The participantId of the user sharing the video.
  12. * @returns {{
  13. * type: SET_SHARED_VIDEO_STATUS,
  14. * ownerId: string,
  15. * status: string,
  16. * time: number,
  17. * videoId: string
  18. * }}
  19. */
  20. export function setSharedVideoStatus(videoId: string, status: string, time: number, ownerId: string) {
  21. return {
  22. type: SET_SHARED_VIDEO_STATUS,
  23. ownerId,
  24. status,
  25. time,
  26. videoId
  27. };
  28. }
  29. /**
  30. * Starts the flow for starting or stopping a shared video.
  31. *
  32. * @returns {{
  33. * type: TOGGLE_SHARED_VIDEO
  34. * }}
  35. */
  36. export function toggleSharedVideo() {
  37. return {
  38. type: TOGGLE_SHARED_VIDEO
  39. };
  40. }
  41. /**
  42. * Displays the prompt for entering the video link.
  43. *
  44. * @param {Function} onPostSubmit - The function to be invoked when a valid link is entered.
  45. * @returns {Function}
  46. */
  47. export function showSharedVideoDialog(onPostSubmit: ?Function) {
  48. return openDialog(SharedVideoDialog, { onPostSubmit });
  49. }