Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moves checkbox for hiding self view to video tab from the general tab #14553

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions react/features/base/settings/actionTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* audioOutputDeviceId: string,
* avatarURL: string,
* cameraDeviceId: string,
* disableSelfView: boolean,
* displayName: string,
* email: string,
* localFlipX: boolean,
Expand Down
1 change: 1 addition & 0 deletions react/features/base/settings/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { ISettingsState } from './reducer';
* audioOutputDeviceId: string,
* avatarURL: string,
* cameraDeviceId: string,
* disableSelfView: boolean,
* displayName: string,
* email: string,
* localFlipX: boolean,
Expand Down
2 changes: 1 addition & 1 deletion react/features/base/ui/components/web/ContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ interface IProps {
/**
* Children of the context menu.
*/
children: ReactNode;
children?: ReactNode;

/**
* Class name for context menu. Used to overwrite default styles.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ export interface IProps extends AbstractDialogTabProps, WithTranslation {
*/
disableDeviceChange: boolean;

/**
* Whether or not the local video is hidden.
*/
disableSelfView: boolean;

/**
* Whether video input dropdown should be enabled or not.
*/
Expand Down Expand Up @@ -203,6 +208,7 @@ class VideoDeviceSelection extends AbstractDialogTab<IProps, IState> {
*/
render() {
const {
disableSelfView,
hideAdditionalSettings,
hideVideoInputPreview,
localFlipX,
Expand Down Expand Up @@ -231,6 +237,11 @@ class VideoDeviceSelection extends AbstractDialogTab<IProps, IState> {
label = { t('videothumbnail.mirrorVideo') }
// eslint-disable-next-line react/jsx-no-bind
onChange = { () => super._onChange({ localFlipX: !localFlipX }) } />
<Checkbox
checked = { Boolean(disableSelfView) }
label = { t('videothumbnail.hideSelfView') }
// eslint-disable-next-line react/jsx-no-bind
onChange = { () => super._onChange({ disableSelfView: !disableSelfView }) } />
</div>
{this._renderFramerateSelect()}
</>
Expand Down
11 changes: 0 additions & 11 deletions react/features/settings/components/native/GeneralSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const GeneralSection = () => {
const { t } = useTranslation();
const dispatch = useDispatch();
const {
disableSelfView,
userSelectedSkipPrejoin
} = useSelector((state: IReduxState) => state['features/base/settings']);

Expand All @@ -32,10 +31,6 @@ const GeneralSection = () => {

const { language = DEFAULT_LANGUAGE } = i18next;

const onSelfViewToggled = useCallback((enabled?: boolean) =>
dispatch(updateSettings({ disableSelfView: enabled }))
, [ dispatch, updateSettings ]);

const onShowPejoinToggled = useCallback((enabled?: boolean) => {
dispatch(updateSettings({ userSelectedSkipPrejoin: !enabled }));
}
Expand All @@ -51,12 +46,6 @@ const GeneralSection = () => {

return (
<FormSection>
<FormRow label = 'videothumbnail.hideSelfView'>
<Switch
checked = { Boolean(disableSelfView) }
onChange = { onSelfViewToggled } />
</FormRow>

{showPrejoinSettings && <FormRow label = 'prejoin.showScreen'>
<Switch
checked = { showPrejoinPage }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,21 @@ export interface IProps {
*/
changeFlip: (flip: boolean) => void;

/**
* Callback to change the selfView state.
*/
changeSelfView: (selfView: boolean) => void;

/**
* The deviceId of the camera device currently being used.
*/
currentCameraDeviceId: string;

/**
* Whether or not the local video is hidden.
*/
disableSelfView: boolean;

/**
* Whether or not the local video is flipped.
*/
Expand Down Expand Up @@ -145,7 +155,9 @@ const stopPropagation = (e: React.MouseEvent) => {

const VideoSettingsContent = ({
changeFlip,
changeSelfView,
currentCameraDeviceId,
disableSelfView,
localFlipX,
selectBackground,
setVideoInputDevice,
Expand All @@ -171,6 +183,15 @@ const VideoSettingsContent = ({
changeFlip(!localFlipX);
}, [ localFlipX, changeFlip ]);

/**
* Toggles local video view based on the provided 'enabled' state.
*
* @returns {void}
*/
const _onSelfViewToggled = useCallback(() => {
changeSelfView(!disableSelfView);
}, [ disableSelfView, changeSelfView ]);

/**
* Destroys all the tracks from trackData object.
*
Expand Down Expand Up @@ -317,6 +338,10 @@ const VideoSettingsContent = ({
checked = { localFlipX }
label = { t('videothumbnail.mirrorVideo') }
onChange = { _onToggleFlip } />
<Checkbox
checked = { Boolean(disableSelfView) }
label = { t('videothumbnail.hideSelfView') }
onChange = { _onSelfViewToggled } />
</div>
</ContextMenuItemGroup>
</ContextMenu>
Expand All @@ -325,9 +350,11 @@ const VideoSettingsContent = ({

const mapStateToProps = (state: IReduxState) => {
const { localFlipX } = state['features/base/settings'];
const { disableSelfView } = state['features/base/settings'];

return {
localFlipX: Boolean(localFlipX),
disableSelfView: Boolean(disableSelfView),
visibleVirtualBackground: checkBlurSupport()
&& checkVirtualBackgroundEnabled(state)
};
Expand All @@ -340,6 +367,11 @@ const mapDispatchToProps = (dispatch: IStore['dispatch']) => {
dispatch(updateSettings({
localFlipX: flip
}));
},
changeSelfView: (selfView: boolean) => {
dispatch(updateSettings({
disableSelfView: selfView
}));
}
};
};
Expand Down
Loading