Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
feat(overlay) drop permissions overlay
Saúl Ibarra Corretgé3745c19857bd
diff --git a/conference.js b/conference.jsindex 14d1c0f769..931c103e50 100644--- a/conference.js+++ b/conference.js@@ -155,7 +155,6 @@ import {NOTIFICATION_TIMEOUT_TYPE} from './react/features/notifications/constants';import { isModerationNotificationDisplayed } from './react/features/notifications/functions';-import { mediaPermissionPromptVisibilityChanged } from './react/features/overlay/actions';import { suspendDetected } from './react/features/power-monitor/actions';import { initPrejoin, isPrejoinPageVisible } from './react/features/prejoin/functions';import { disableReceiver, stopReceiver } from './react/features/remote-control/actions';@@ -435,15 +434,6 @@ export default {requestedVideo = true;}- if (!config.disableInitialGUM) {- JitsiMeetJS.mediaDevices.addEventListener(- JitsiMediaDevicesEvents.PERMISSION_PROMPT_IS_SHOWN,- browserName =>- APP.store.dispatch(- mediaPermissionPromptVisibilityChanged(true, browserName))- );- }-let tryCreateLocalTracks = Promise.resolve([]);// On Electron there is no permission prompt for granting permissions. That's why we don't need to@@ -497,15 +487,6 @@ export default {});}- // Hide the permissions prompt/overlay as soon as the tracks are created. Don't wait for the connection to- // be established, as in some cases like when auth is required, connection won't be established until the user- // inputs their credentials, but the dialog would be overshadowed by the overlay.- tryCreateLocalTracks.then(tracks => {- APP.store.dispatch(mediaPermissionPromptVisibilityChanged(false));-- return tracks;- });-return {tryCreateLocalTracks,errorsdiff --git a/react/features/app/reducers.any.ts b/react/features/app/reducers.any.tsindex e2526a0230..28e22b3088 100644--- a/react/features/app/reducers.any.ts+++ b/react/features/app/reducers.any.ts@@ -38,7 +38,6 @@ import '../jaas/reducer';import '../large-video/reducer';import '../lobby/reducer';import '../notifications/reducer';-import '../overlay/reducer';import '../participants-pane/reducer';import '../polls/reducer';import '../polls-history/reducer';diff --git a/react/features/app/types.ts b/react/features/app/types.tsindex 6891d99a8e..28a07e7664 100644--- a/react/features/app/types.ts+++ b/react/features/app/types.ts@@ -57,7 +57,6 @@ import { INoAudioSignalState } from '../no-audio-signal/reducer';import { INoiseDetectionState } from '../noise-detection/reducer';import { INoiseSuppressionState } from '../noise-suppression/reducer';import { INotificationsState } from '../notifications/reducer';-import { IOverlayState } from '../overlay/reducer';import { IParticipantsPaneState } from '../participants-pane/reducer';import { IPollsState } from '../polls/reducer';import { IPollsHistoryState } from '../polls-history/reducer';@@ -147,7 +146,6 @@ export interface IReduxState {'features/noise-detection': INoiseDetectionState;'features/noise-suppression': INoiseSuppressionState;'features/notifications': INotificationsState;- 'features/overlay': IOverlayState;'features/participants-pane': IParticipantsPaneState;'features/polls': IPollsState;'features/polls-history': IPollsHistoryState;diff --git a/react/features/overlay/actionTypes.ts b/react/features/overlay/actionTypes.tsdeleted file mode 100644index a2b98538d1..0000000000--- a/react/features/overlay/actionTypes.ts+++ /dev/null@@ -1,13 +0,0 @@-/**- * The type of the Redux action which signals that the prompt for media- * permission is visible or not.- *- * {- * type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,- * isVisible: {boolean},- * browser: {string}- * }- * @public- */-export const MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED- = 'MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED';diff --git a/react/features/overlay/actions.native.ts b/react/features/overlay/actions.native.tsindex 0308eb9269..5feaa12899 100644--- a/react/features/overlay/actions.native.ts+++ b/react/features/overlay/actions.native.ts@@ -3,23 +3,6 @@ import { openDialog } from '../base/dialog/actions';import PageReloadDialog from '../base/dialog/components/native/PageReloadDialog';-/**- * Signals that the prompt for media permission is visible or not.- *- * @param {boolean} _isVisible - If the value is true - the prompt for media- * permission is visible otherwise the value is false/undefined.- * @param {string} _browser - The name of the current browser.- * @public- * @returns {{- * type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,- * browser: {string},- * isVisible: {boolean}- * }}- */-export function mediaPermissionPromptVisibilityChanged(_isVisible: boolean, _browser: string) {- // Dummy.-}-/*** Opens {@link PageReloadDialog}.*diff --git a/react/features/overlay/actions.web.ts b/react/features/overlay/actions.web.tsindex 88d729f150..3c7a422ded 100644--- a/react/features/overlay/actions.web.ts+++ b/react/features/overlay/actions.web.ts@@ -1,26 +1,3 @@-import { MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED } from './actionTypes';---/**- * Signals that the prompt for media permission is visible or not.- *- * @param {boolean} isVisible - If the value is true - the prompt for media- * permission is visible otherwise the value is false/undefined.- * @param {string} browser - The name of the current browser.- * @public- * @returns {{- * type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,- * browser: {string},- * isVisible: {boolean}- * }}- */-export function mediaPermissionPromptVisibilityChanged(isVisible: boolean, browser: string) {- return {- type: MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,- browser,- isVisible- };-}/*** Opens {@link PageReloadDialog}.diff --git a/react/features/overlay/components/web/UserMediaPermissionsOverlay.tsx b/react/features/overlay/components/web/UserMediaPermissionsOverlay.tsxdeleted file mode 100644index bdc1ade812..0000000000--- a/react/features/overlay/components/web/UserMediaPermissionsOverlay.tsx+++ /dev/null@@ -1,123 +0,0 @@-import React, { Component } from 'react';-import { WithTranslation } from 'react-i18next';-import { connect } from 'react-redux';--import { IReduxState } from '../../../app/types';-import { translate, translateToHTML } from '../../../base/i18n/functions';--import OverlayFrame from './OverlayFrame';--/**- * The type of the React {@code Component} props of- * {@link UserMediaPermissionsOverlay}.- */-interface IProps extends WithTranslation {-- _premeetingBackground?: any;-}--/**- * Implements a React Component for overlay with guidance how to proceed with- * gUM prompt.- */-class UserMediaPermissionsOverlay extends Component<IProps> {- /**- * Determines whether this overlay needs to be rendered (according to a- * specific redux state). Called by {@link OverlayContainer}.- *- * @param {Object} state - The redux state.- * @returns {boolean} - If this overlay needs to be rendered, {@code true};- * {@code false}, otherwise.- */- static needsRender(state: IReduxState) {- return state['features/overlay'].isMediaPermissionPromptVisible;- }-- /**- * Implements React's {@link Component#render()}.- *- * @inheritdoc- * @returns {ReactElement}- */- render() {- const { _premeetingBackground, t } = this.props;- const style = _premeetingBackground ? {- background: _premeetingBackground,- backgroundPosition: 'center',- backgroundSize: 'cover'- } : {};-- return (- <OverlayFrame style = { style }>- <div className = 'inlay'>- <span className = 'inlay__icon icon-microphone' />- <span className = 'inlay__icon icon-camera' />- <h3- aria-label = { t('startupoverlay.genericTitle') }- className = 'inlay__title'- role = 'alert' >- {- t('startupoverlay.genericTitle')- }- </h3>- <span- className = 'inlay__text'- role = 'alert' >- {- t('userMedia.grantPermissions')- }- </span>- </div>- <div className = 'policy overlay__policy'>- <p- className = 'policy__text'- role = 'alert'>- { translateToHTML(t, 'startupoverlay.policyText') }- </p>- {- this._renderPolicyLogo()- }- </div>- </OverlayFrame>- );- }-- /**- * Renders the policy logo.- *- * @private- * @returns {ReactElement|null}- */- _renderPolicyLogo() {- const policyLogoSrc = interfaceConfig.POLICY_LOGO;-- if (policyLogoSrc) {- return (- <div className = 'policy__logo'>- <img- alt = { this.props.t('welcomepage.logo.policyLogo') }- src = { policyLogoSrc } />- </div>- );- }-- return null;- }-}--/**- * Maps (parts of) the redux state to the React {@code Component} props.- *- * @param {Object} state - The redux state.- * @param {Object} ownProps - The props passed to the component.- * @returns {Object}- */-function mapStateToProps(state: IReduxState) {- const { premeetingBackground } = state['features/dynamic-branding'];-- return {- _premeetingBackground: premeetingBackground- };-}--export default translate(connect(mapStateToProps)(UserMediaPermissionsOverlay));diff --git a/react/features/overlay/functions.web.ts b/react/features/overlay/functions.web.tsindex 119739926b..ef0b2100fc 100644--- a/react/features/overlay/functions.web.ts+++ b/react/features/overlay/functions.web.ts@@ -2,7 +2,6 @@ import { IReduxState } from '../app/types';import PageReloadOverlay from './components/web/PageReloadOverlay';import SuspendedOverlay from './components/web/SuspendedOverlay';-import UserMediaPermissionsOverlay from './components/web/UserMediaPermissionsOverlay';/*** Returns the overlay to be currently rendered.@@ -13,8 +12,7 @@ import UserMediaPermissionsOverlay from './components/web/UserMediaPermissionsOvexport function getOverlayToRender(state: IReduxState) {const overlays = [PageReloadOverlay,- SuspendedOverlay,- UserMediaPermissionsOverlay+ SuspendedOverlay];for (const overlay of overlays) {diff --git a/react/features/overlay/reducer.ts b/react/features/overlay/reducer.tsdeleted file mode 100644index b997cb583e..0000000000--- a/react/features/overlay/reducer.ts+++ /dev/null@@ -1,43 +0,0 @@-import ReducerRegistry from '../base/redux/ReducerRegistry';-import { assign } from '../base/redux/functions';--import { MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED } from './actionTypes';---export interface IOverlayState {- browser?: string;- isMediaPermissionPromptVisible?: boolean;-}--/**- * Reduces the redux actions of the feature overlay.- *- * FIXME: these pieces of state should probably be in a different place.- */-ReducerRegistry.register<IOverlayState>('features/overlay', (state = {}, action): IOverlayState => {- switch (action.type) {- case MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED:- return _mediaPermissionPromptVisibilityChanged(state, action);- }-- return state;-});--/**- * Reduces a specific redux action MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED of- * the feature overlay.- *- * @param {Object} state - The redux state of the feature overlay.- * @param {Action} action - The redux action to reduce.- * @private- * @returns {Object} The new state of the feature overlay after the reduction of- * the specified action.- */-function _mediaPermissionPromptVisibilityChanged(- state: IOverlayState,- { browser, isVisible }: { browser?: string; isVisible?: boolean; }) {- return assign(state, {- browser,- isMediaPermissionPromptVisible: isVisible- });-}