選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

actions.native.ts 2.8KB

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