Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

actions.native.js 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. import type { Dispatch } from 'redux';
  2. import { openSheet } 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. import RoomParticipantMenu from './components/native/RoomParticipantMenu';
  13. export * from './actions.any';
  14. /**
  15. * Displays the context menu for the selected lobby participant.
  16. *
  17. * @param {Object} participant - The selected lobby participant.
  18. * @returns {Function}
  19. */
  20. export function showContextMenuReject(participant: Object) {
  21. return openSheet(ContextMenuLobbyParticipantReject, { participant });
  22. }
  23. /**
  24. * Displays the connection status for the local meeting participant.
  25. *
  26. * @param {string} participantID - The selected meeting participant id.
  27. * @returns {Function}
  28. */
  29. export function showConnectionStatus(participantID: string) {
  30. return openSheet(ConnectionStatusComponent, { participantID });
  31. }
  32. /**
  33. * Displays the context menu for the selected meeting participant.
  34. *
  35. * @param {string} participantId - The ID of the selected meeting participant.
  36. * @param {boolean} local - Whether the participant is local or not.
  37. * @returns {Function}
  38. */
  39. export function showContextMenuDetails(participantId: string, local: boolean = false) {
  40. return (dispatch: Dispatch<any>, getState: Function) => {
  41. const { remoteVideoMenu } = getState()['features/base/config'];
  42. if (local) {
  43. dispatch(openSheet(LocalVideoMenu));
  44. } else if (!remoteVideoMenu?.disabled) {
  45. dispatch(openSheet(RemoteVideoMenu, { participantId }));
  46. }
  47. };
  48. }
  49. /**
  50. * Displays the shared video menu.
  51. *
  52. * @param {string} participantId - The ID of the selected meeting participant.
  53. * @returns {Function}
  54. */
  55. export function showSharedVideoMenu(participantId: string) {
  56. return openSheet(SharedVideoMenu, { participantId });
  57. }
  58. /**
  59. * Sets the volume.
  60. *
  61. * @param {string} participantId - The participant ID associated with the audio.
  62. * @param {string} volume - The volume level.
  63. * @returns {{
  64. * type: SET_VOLUME,
  65. * participantId: string,
  66. * volume: number
  67. * }}
  68. */
  69. export function setVolume(participantId: string, volume: number) {
  70. return {
  71. type: SET_VOLUME,
  72. participantId,
  73. volume
  74. };
  75. }
  76. /**
  77. * Displays the breakout room participant menu.
  78. *
  79. * @param {Object} room - The room the participant is in.
  80. * @param {string} participantJid - The jid of the participant.
  81. * @param {string} participantName - The display name of the participant.
  82. * @returns {Function}
  83. */
  84. export function showRoomParticipantMenu(room: Object, participantJid: string, participantName: string) {
  85. return openSheet(RoomParticipantMenu, { room,
  86. participantJid,
  87. participantName });
  88. }