feat(rn,flags) add fullscreen.enabled flag

This commit is contained in:
Jean-François Alarie 2021-03-08 22:11:39 +01:00 committed by GitHub
parent 1a62a7b1cc
commit 407021e258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 4 deletions

View File

@ -56,6 +56,12 @@ export const CHAT_ENABLED = 'chat.enabled';
*/
export const FILMSTRIP_ENABLED = 'filmstrip.enabled';
/**
* Flag indicating if fullscreen (immersive) mode should be enabled.
* Default: enabled (true).
*/
export const FULLSCREEN_ENABLED = 'fullscreen.enabled';
/**
* Flag indicating if the Help button should be enabled.
* Default: enabled (true).

View File

@ -5,7 +5,7 @@ import { NativeModules, SafeAreaView, StatusBar } from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
import { appNavigate } from '../../../app/actions';
import { PIP_ENABLED, getFeatureFlag } from '../../../base/flags';
import { PIP_ENABLED, FULLSCREEN_ENABLED, getFeatureFlag } from '../../../base/flags';
import { Container, LoadingIndicator, TintedView } from '../../../base/react';
import { connect } from '../../../base/redux';
import { ASPECT_RATIO_NARROW } from '../../../base/responsive-ui/constants';
@ -68,6 +68,11 @@ type Props = AbstractProps & {
*/
_filmstripVisible: boolean,
/**
* The indicator which determines whether fullscreen (immersive) mode is enabled.
*/
_fullscreenEnabled: boolean,
/**
* The ID of the participant currently on stage (if any)
*/
@ -145,12 +150,14 @@ class Conference extends AbstractConference<Props, *> {
* @returns {ReactElement}
*/
render() {
const { _fullscreenEnabled } = this.props;
return (
<Container style = { styles.conference }>
<StatusBar
barStyle = 'light-content'
hidden = { true }
translucent = { true } />
hidden = { _fullscreenEnabled }
translucent = { _fullscreenEnabled } />
{ this._renderContent() }
</Container>
);
@ -443,6 +450,7 @@ function _mapStateToProps(state) {
_calendarEnabled: isCalendarEnabled(state),
_connecting: Boolean(connecting_),
_filmstripVisible: isFilmstripVisible(state),
_fullscreenEnabled: getFeatureFlag(state, FULLSCREEN_ENABLED, true),
_largeVideoParticipantId: state['features/large-video'].participantId,
_pictureInPictureEnabled: getFeatureFlag(state, PIP_ENABLED),
_reducedUI: reducedUI,

View File

@ -5,6 +5,7 @@ import { Immersive } from 'react-native-immersive';
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../base/app';
import { getCurrentConference } from '../../base/conference';
import { isAnyDialogOpen } from '../../base/dialog/functions';
import { FULLSCREEN_ENABLED, getFeatureFlag } from '../../base/flags';
import { Platform } from '../../base/react';
import { MiddlewareRegistry, StateListenerRegistry } from '../../base/redux';
@ -50,8 +51,9 @@ StateListenerRegistry.register(
const { enabled: audioOnly } = state['features/base/audio-only'];
const conference = getCurrentConference(state);
const dialogOpen = isAnyDialogOpen(state);
const fullscreenEnabled = getFeatureFlag(state, FULLSCREEN_ENABLED, true);
return conference ? !audioOnly && !dialogOpen : false;
return conference ? !audioOnly && !dialogOpen && fullscreenEnabled : false;
},
/* listener */ fullScreen => _setFullScreen(fullScreen)
);