2022-10-13 08:26:28 +00:00
|
|
|
/* eslint-disable lines-around-comment */
|
|
|
|
import { IStore } from '../app/types';
|
|
|
|
import { openSheet } from '../base/dialog/actions';
|
|
|
|
// @ts-ignore
|
2021-08-04 08:51:05 +00:00
|
|
|
import { SharedVideoMenu } from '../video-menu';
|
2022-10-13 08:26:28 +00:00
|
|
|
// @ts-ignore
|
2022-01-28 10:47:54 +00:00
|
|
|
import { LocalVideoMenu } from '../video-menu/components/native';
|
2021-07-30 09:46:49 +00:00
|
|
|
import ConnectionStatusComponent
|
2022-10-13 08:26:28 +00:00
|
|
|
// @ts-ignore
|
2021-07-30 09:46:49 +00:00
|
|
|
from '../video-menu/components/native/ConnectionStatusComponent';
|
2022-10-13 08:26:28 +00:00
|
|
|
// @ts-ignore
|
2021-07-30 09:46:49 +00:00
|
|
|
import RemoteVideoMenu from '../video-menu/components/native/RemoteVideoMenu';
|
2021-06-03 16:23:18 +00:00
|
|
|
|
2021-07-01 10:12:38 +00:00
|
|
|
import { SET_VOLUME } from './actionTypes';
|
2022-06-23 07:40:11 +00:00
|
|
|
import RoomParticipantMenu from './components/native/RoomParticipantMenu';
|
2021-06-04 15:07:18 +00:00
|
|
|
|
2023-02-06 13:48:22 +00:00
|
|
|
export * from './actions.any';
|
2021-06-04 15:07:18 +00:00
|
|
|
|
|
|
|
/**
|
2021-07-30 09:46:49 +00:00
|
|
|
* Displays the connection status for the local meeting participant.
|
2021-06-04 15:07:18 +00:00
|
|
|
*
|
2021-07-12 15:14:38 +00:00
|
|
|
* @param {string} participantID - The selected meeting participant id.
|
2021-06-04 15:07:18 +00:00
|
|
|
* @returns {Function}
|
|
|
|
*/
|
2021-09-01 23:13:16 +00:00
|
|
|
export function showConnectionStatus(participantID: string) {
|
2022-06-20 14:53:19 +00:00
|
|
|
return openSheet(ConnectionStatusComponent, { participantID });
|
2021-07-30 09:46:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Displays the context menu for the selected meeting participant.
|
|
|
|
*
|
2021-09-01 23:13:16 +00:00
|
|
|
* @param {string} participantId - The ID of the selected meeting participant.
|
2022-01-28 10:47:54 +00:00
|
|
|
* @param {boolean} local - Whether the participant is local or not.
|
2021-07-30 09:46:49 +00:00
|
|
|
* @returns {Function}
|
|
|
|
*/
|
2022-10-13 08:26:28 +00:00
|
|
|
export function showContextMenuDetails(participantId: string, local = false) {
|
|
|
|
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
|
2022-03-14 14:46:19 +00:00
|
|
|
const { remoteVideoMenu } = getState()['features/base/config'];
|
|
|
|
|
|
|
|
if (local) {
|
2022-06-20 14:53:19 +00:00
|
|
|
dispatch(openSheet(LocalVideoMenu));
|
2022-03-14 14:46:19 +00:00
|
|
|
} else if (!remoteVideoMenu?.disabled) {
|
2022-06-20 14:53:19 +00:00
|
|
|
dispatch(openSheet(RemoteVideoMenu, { participantId }));
|
2022-03-14 14:46:19 +00:00
|
|
|
}
|
|
|
|
};
|
2021-06-03 16:23:18 +00:00
|
|
|
}
|
2021-07-01 10:12:38 +00:00
|
|
|
|
2021-08-04 08:51:05 +00:00
|
|
|
/**
|
|
|
|
* Displays the shared video menu.
|
|
|
|
*
|
2021-09-01 23:13:16 +00:00
|
|
|
* @param {string} participantId - The ID of the selected meeting participant.
|
2021-08-04 08:51:05 +00:00
|
|
|
* @returns {Function}
|
|
|
|
*/
|
2021-09-01 23:13:16 +00:00
|
|
|
export function showSharedVideoMenu(participantId: string) {
|
2022-06-20 14:53:19 +00:00
|
|
|
return openSheet(SharedVideoMenu, { participantId });
|
2021-08-04 08:51:05 +00:00
|
|
|
}
|
|
|
|
|
2021-07-01 10:12:38 +00:00
|
|
|
/**
|
|
|
|
* Sets the volume.
|
|
|
|
*
|
|
|
|
* @param {string} participantId - The participant ID associated with the audio.
|
|
|
|
* @param {string} volume - The volume level.
|
|
|
|
* @returns {{
|
|
|
|
* type: SET_VOLUME,
|
|
|
|
* participantId: string,
|
|
|
|
* volume: number
|
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
export function setVolume(participantId: string, volume: number) {
|
|
|
|
return {
|
|
|
|
type: SET_VOLUME,
|
|
|
|
participantId,
|
|
|
|
volume
|
|
|
|
};
|
|
|
|
}
|
2022-06-23 07:40:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Displays the breakout room participant menu.
|
|
|
|
*
|
|
|
|
* @param {Object} room - The room the participant is in.
|
|
|
|
* @param {string} participantJid - The jid of the participant.
|
|
|
|
* @param {string} participantName - The display name of the participant.
|
|
|
|
* @returns {Function}
|
|
|
|
*/
|
|
|
|
export function showRoomParticipantMenu(room: Object, participantJid: string, participantName: string) {
|
2022-10-13 08:26:28 +00:00
|
|
|
// @ts-ignore
|
2022-06-23 07:40:11 +00:00
|
|
|
return openSheet(RoomParticipantMenu, { room,
|
|
|
|
participantJid,
|
|
|
|
participantName });
|
|
|
|
}
|