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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 (dispatch: Dispatch<any>, getState: Function) => {
  40. const { remoteVideoMenu } = getState()['features/base/config'];
  41. if (local) {
  42. dispatch(openDialog(LocalVideoMenu));
  43. } else if (!remoteVideoMenu?.disabled) {
  44. dispatch(openDialog(RemoteVideoMenu, { participantId }));
  45. }
  46. };
  47. }
  48. /**
  49. * Displays the shared video menu.
  50. *
  51. * @param {string} participantId - The ID of the selected meeting participant.
  52. * @returns {Function}
  53. */
  54. export function showSharedVideoMenu(participantId: string) {
  55. return openDialog(SharedVideoMenu, { participantId });
  56. }
  57. /**
  58. * Sets the volume.
  59. *
  60. * @param {string} participantId - The participant ID associated with the audio.
  61. * @param {string} volume - The volume level.
  62. * @returns {{
  63. * type: SET_VOLUME,
  64. * participantId: string,
  65. * volume: number
  66. * }}
  67. */
  68. export function setVolume(participantId: string, volume: number) {
  69. return {
  70. type: SET_VOLUME,
  71. participantId,
  72. volume
  73. };
  74. }