2021-06-29 14:05:11 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
2022-08-26 09:54:16 +00:00
|
|
|
import Icon from '../base/icons/components/Icon';
|
2021-06-29 14:05:11 +00:00
|
|
|
import {
|
2022-11-08 10:24:32 +00:00
|
|
|
IconMic,
|
|
|
|
IconMicSlash,
|
|
|
|
IconVideo,
|
|
|
|
IconVideoOff
|
2022-08-26 09:54:16 +00:00
|
|
|
} from '../base/icons/svg';
|
2021-06-29 14:05:11 +00:00
|
|
|
|
2021-04-21 13:48:05 +00:00
|
|
|
/**
|
|
|
|
* Reducer key for the feature.
|
|
|
|
*/
|
|
|
|
export const REDUCER_KEY = 'features/participants-pane';
|
|
|
|
|
2022-09-08 09:52:36 +00:00
|
|
|
export type ActionTrigger = 'Hover' | 'Permanent';
|
2021-06-23 11:23:44 +00:00
|
|
|
|
2021-04-21 13:48:05 +00:00
|
|
|
/**
|
|
|
|
* Enum of possible participant action triggers.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
export const ACTION_TRIGGER: { HOVER: ActionTrigger; PERMANENT: ActionTrigger; } = {
|
2021-06-23 11:23:44 +00:00
|
|
|
HOVER: 'Hover',
|
|
|
|
PERMANENT: 'Permanent'
|
2021-04-21 13:48:05 +00:00
|
|
|
};
|
|
|
|
|
2021-08-18 12:10:16 +00:00
|
|
|
export type MediaState = 'DominantSpeaker' | 'Muted' | 'ForceMuted' | 'Unmuted' | 'None';
|
2021-06-23 11:23:44 +00:00
|
|
|
|
2021-04-21 13:48:05 +00:00
|
|
|
/**
|
|
|
|
* Enum of possible participant media states.
|
|
|
|
*/
|
2022-09-08 09:52:36 +00:00
|
|
|
export const MEDIA_STATE: { [key: string]: MediaState; } = {
|
2021-08-18 12:10:16 +00:00
|
|
|
DOMINANT_SPEAKER: 'DominantSpeaker',
|
2021-06-23 11:23:44 +00:00
|
|
|
MUTED: 'Muted',
|
|
|
|
FORCE_MUTED: 'ForceMuted',
|
|
|
|
UNMUTED: 'Unmuted',
|
|
|
|
NONE: 'None'
|
|
|
|
};
|
|
|
|
|
|
|
|
export type QuickActionButtonType = 'Mute' | 'AskToUnmute' | 'None';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enum of possible participant mute button states.
|
|
|
|
*/
|
|
|
|
export const QUICK_ACTION_BUTTON: {
|
2022-09-08 09:52:36 +00:00
|
|
|
ASK_TO_UNMUTE: QuickActionButtonType;
|
|
|
|
MUTE: QuickActionButtonType;
|
|
|
|
NONE: QuickActionButtonType;
|
2021-06-23 11:23:44 +00:00
|
|
|
} = {
|
|
|
|
MUTE: 'Mute',
|
|
|
|
ASK_TO_UNMUTE: 'AskToUnmute',
|
|
|
|
NONE: 'None'
|
2021-04-21 13:48:05 +00:00
|
|
|
};
|
2021-06-29 14:05:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Icon mapping for possible participant audio states.
|
|
|
|
*/
|
2022-08-26 09:54:16 +00:00
|
|
|
export const AudioStateIcons = {
|
2021-08-18 12:10:16 +00:00
|
|
|
[MEDIA_STATE.DOMINANT_SPEAKER]: (
|
|
|
|
<Icon
|
2021-08-19 11:08:30 +00:00
|
|
|
className = 'jitsi-icon-dominant-speaker'
|
2021-08-18 12:10:16 +00:00
|
|
|
size = { 16 }
|
2022-11-08 10:24:32 +00:00
|
|
|
src = { IconMic } />
|
2021-08-18 12:10:16 +00:00
|
|
|
),
|
2021-06-29 14:05:11 +00:00
|
|
|
[MEDIA_STATE.FORCE_MUTED]: (
|
|
|
|
<Icon
|
|
|
|
color = '#E04757'
|
|
|
|
size = { 16 }
|
2022-11-08 10:24:32 +00:00
|
|
|
src = { IconMicSlash } />
|
2021-06-29 14:05:11 +00:00
|
|
|
),
|
|
|
|
[MEDIA_STATE.MUTED]: (
|
|
|
|
<Icon
|
|
|
|
size = { 16 }
|
2022-11-08 10:24:32 +00:00
|
|
|
src = { IconMicSlash } />
|
2021-06-29 14:05:11 +00:00
|
|
|
),
|
|
|
|
[MEDIA_STATE.UNMUTED]: (
|
|
|
|
<Icon
|
|
|
|
size = { 16 }
|
2022-11-08 10:24:32 +00:00
|
|
|
src = { IconMic } />
|
2021-06-29 14:05:11 +00:00
|
|
|
),
|
|
|
|
[MEDIA_STATE.NONE]: null
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Icon mapping for possible participant video states.
|
|
|
|
*/
|
|
|
|
export const VideoStateIcons = {
|
2022-01-07 10:54:42 +00:00
|
|
|
[MEDIA_STATE.DOMINANT_SPEAKER]: null,
|
2021-06-29 14:05:11 +00:00
|
|
|
[MEDIA_STATE.FORCE_MUTED]: (
|
|
|
|
<Icon
|
2021-09-10 11:05:16 +00:00
|
|
|
color = '#E04757'
|
2021-12-15 13:18:41 +00:00
|
|
|
id = 'videoMuted'
|
2021-06-29 14:05:11 +00:00
|
|
|
size = { 16 }
|
2022-11-08 10:24:32 +00:00
|
|
|
src = { IconVideoOff } />
|
2021-06-29 14:05:11 +00:00
|
|
|
),
|
|
|
|
[MEDIA_STATE.MUTED]: (
|
|
|
|
<Icon
|
2021-12-15 13:18:41 +00:00
|
|
|
id = 'videoMuted'
|
2021-06-29 14:05:11 +00:00
|
|
|
size = { 16 }
|
2022-11-08 10:24:32 +00:00
|
|
|
src = { IconVideoOff } />
|
2021-06-29 14:05:11 +00:00
|
|
|
),
|
|
|
|
[MEDIA_STATE.UNMUTED]: (
|
|
|
|
<Icon
|
|
|
|
size = { 16 }
|
2022-11-08 10:24:32 +00:00
|
|
|
src = { IconVideo } />
|
2021-06-29 14:05:11 +00:00
|
|
|
),
|
|
|
|
[MEDIA_STATE.NONE]: null
|
|
|
|
};
|
2022-06-23 07:40:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Mobile web context menu avatar size.
|
|
|
|
*/
|
|
|
|
export const AVATAR_SIZE = 20;
|