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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // @flow
  2. import { openDialog } from '../base/dialog';
  3. import { SharedVideoMenu } from '../video-menu';
  4. import { LocalVideoMenu } from '../video-menu/components/native';
  5. import ConnectionStatusComponent
  6. from '../video-menu/components/native/ConnectionStatusComponent';
  7. import RemoteVideoMenu from '../video-menu/components/native/RemoteVideoMenu';
  8. import { SET_VOLUME } from './actionTypes';
  9. import {
  10. ContextMenuLobbyParticipantReject
  11. } from './components/native';
  12. export * from './actions.any';
  13. /**
  14. * Displays the context menu for the selected lobby participant.
  15. *
  16. * @param {Object} participant - The selected lobby participant.
  17. * @returns {Function}
  18. */
  19. export function showContextMenuReject(participant: Object) {
  20. return openDialog(ContextMenuLobbyParticipantReject, { participant });
  21. }
  22. /**
  23. * Displays the connection status for the local meeting participant.
  24. *
  25. * @param {string} participantID - The selected meeting participant id.
  26. * @returns {Function}
  27. */
  28. export function showConnectionStatus(participantID: string) {
  29. return openDialog(ConnectionStatusComponent, { participantID });
  30. }
  31. /**
  32. * Displays the context menu for the selected meeting participant.
  33. *
  34. * @param {string} participantId - The ID of the selected meeting participant.
  35. * @param {boolean} local - Whether the participant is local or not.
  36. * @returns {Function}
  37. */
  38. export function showContextMenuDetails(participantId: string, local: boolean = false) {
  39. return local
  40. ? openDialog(LocalVideoMenu)
  41. : openDialog(RemoteVideoMenu, { participantId });
  42. }
  43. /**
  44. * Displays the shared video menu.
  45. *
  46. * @param {string} participantId - The ID of the selected meeting participant.
  47. * @returns {Function}
  48. */
  49. export function showSharedVideoMenu(participantId: string) {
  50. return openDialog(SharedVideoMenu, { participantId });
  51. }
  52. /**
  53. * Sets the volume.
  54. *
  55. * @param {string} participantId - The participant ID associated with the audio.
  56. * @param {string} volume - The volume level.
  57. * @returns {{
  58. * type: SET_VOLUME,
  59. * participantId: string,
  60. * volume: number
  61. * }}
  62. */
  63. export function setVolume(participantId: string, volume: number) {
  64. return {
  65. type: SET_VOLUME,
  66. participantId,
  67. volume
  68. };
  69. }