2021-06-23 11:23:44 +00:00
|
|
|
// @flow
|
|
|
|
|
2021-06-29 14:05:11 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import {
|
2021-07-02 13:43:52 +00:00
|
|
|
Icon,
|
|
|
|
IconCameraEmpty,
|
|
|
|
IconCameraEmptyDisabled,
|
2021-06-29 14:05:11 +00:00
|
|
|
IconMicrophoneEmpty,
|
|
|
|
IconMicrophoneEmptySlash
|
|
|
|
} from '../base/icons';
|
|
|
|
|
2021-04-21 13:48:05 +00:00
|
|
|
/**
|
|
|
|
* Reducer key for the feature.
|
|
|
|
*/
|
|
|
|
export const REDUCER_KEY = 'features/participants-pane';
|
|
|
|
|
2021-06-23 11:23:44 +00:00
|
|
|
export type ActionTrigger = 'Hover' | 'Permanent'
|
|
|
|
|
2021-04-21 13:48:05 +00:00
|
|
|
/**
|
|
|
|
* Enum of possible participant action triggers.
|
|
|
|
*/
|
2021-06-23 11:23:44 +00:00
|
|
|
export const ACTION_TRIGGER: {HOVER: ActionTrigger, PERMANENT: ActionTrigger} = {
|
|
|
|
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.
|
|
|
|
*/
|
2021-06-23 11:23:44 +00:00
|
|
|
export const MEDIA_STATE: {
|
2021-08-18 12:10:16 +00:00
|
|
|
DOMINANT_SPEAKER: MediaState,
|
2021-06-23 11:23:44 +00:00
|
|
|
MUTED: MediaState,
|
|
|
|
FORCE_MUTED: MediaState,
|
|
|
|
UNMUTED: MediaState,
|
|
|
|
NONE: 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: {
|
|
|
|
MUTE: QuickActionButtonType,
|
|
|
|
ASK_TO_UNMUTE: QuickActionButtonType,
|
|
|
|
NONE: QuickActionButtonType
|
|
|
|
} = {
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
export const AudioStateIcons: {[MediaState]: React$Element<any> | null} = {
|
2021-08-18 12:10:16 +00:00
|
|
|
[MEDIA_STATE.DOMINANT_SPEAKER]: (
|
|
|
|
<Icon
|
|
|
|
color = '#1EC26A'
|
|
|
|
size = { 16 }
|
|
|
|
src = { IconMicrophoneEmpty } />
|
|
|
|
),
|
2021-06-29 14:05:11 +00:00
|
|
|
[MEDIA_STATE.FORCE_MUTED]: (
|
|
|
|
<Icon
|
|
|
|
color = '#E04757'
|
|
|
|
size = { 16 }
|
|
|
|
src = { IconMicrophoneEmptySlash } />
|
|
|
|
),
|
|
|
|
[MEDIA_STATE.MUTED]: (
|
|
|
|
<Icon
|
|
|
|
size = { 16 }
|
|
|
|
src = { IconMicrophoneEmptySlash } />
|
|
|
|
),
|
|
|
|
[MEDIA_STATE.UNMUTED]: (
|
|
|
|
<Icon
|
|
|
|
size = { 16 }
|
|
|
|
src = { IconMicrophoneEmpty } />
|
|
|
|
),
|
|
|
|
[MEDIA_STATE.NONE]: null
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Icon mapping for possible participant video states.
|
|
|
|
*/
|
|
|
|
export const VideoStateIcons = {
|
|
|
|
[MEDIA_STATE.FORCE_MUTED]: (
|
|
|
|
<Icon
|
|
|
|
size = { 16 }
|
|
|
|
src = { IconCameraEmptyDisabled } />
|
|
|
|
),
|
|
|
|
[MEDIA_STATE.MUTED]: (
|
|
|
|
<Icon
|
|
|
|
size = { 16 }
|
|
|
|
src = { IconCameraEmptyDisabled } />
|
|
|
|
),
|
|
|
|
[MEDIA_STATE.UNMUTED]: (
|
|
|
|
<Icon
|
|
|
|
size = { 16 }
|
|
|
|
src = { IconCameraEmpty } />
|
|
|
|
),
|
|
|
|
[MEDIA_STATE.NONE]: null
|
|
|
|
};
|