Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

ref(join) remove overlay shown for a slow gUM flow (#12268)

Avram Tudor3c180d3932cc
diff --git a/conference.js b/conference.js
index 02fe8a8f41..1e9cee0ab1 100644
--- a/conference.js
+++ b/conference.js
@@ -144,7 +144,7 @@ import {
isModerationNotificationDisplayed,
showNotification
} from './react/features/notifications';
-import { mediaPermissionPromptVisibilityChanged, toggleSlowGUMOverlay } from './react/features/overlay';
+import { mediaPermissionPromptVisibilityChanged } from './react/features/overlay';
import { suspendDetected } from './react/features/power-monitor';
import {
initPrejoin,
@@ -519,11 +519,6 @@ export default {
);
}
- JitsiMeetJS.mediaDevices.addEventListener(
- JitsiMediaDevicesEvents.SLOW_GET_USER_MEDIA,
- () => APP.store.dispatch(toggleSlowGUMOverlay(true))
- );
-
let tryCreateLocalTracks;
// On Electron there is no permission prompt for granting permissions. That's why we don't need to
@@ -533,8 +528,7 @@ export default {
const audioOptions = {
devices: [ MEDIA_TYPE.AUDIO ],
timeout,
- firePermissionPromptIsShownEvent: true,
- fireSlowPromiseEvent: true
+ firePermissionPromptIsShownEvent: true
};
// FIXME is there any simpler way to rewrite this spaghetti below ?
@@ -585,8 +579,7 @@ export default {
tryCreateLocalTracks = createLocalTracksF({
devices: initialDevices,
timeout,
- firePermissionPromptIsShownEvent: true,
- fireSlowPromiseEvent: true
+ firePermissionPromptIsShownEvent: true
})
.catch(err => {
if (requestedAudio && requestedVideo) {
@@ -629,8 +622,7 @@ export default {
return requestedVideo
? createLocalTracksF({
devices: [ MEDIA_TYPE.VIDEO ],
- firePermissionPromptIsShownEvent: true,
- fireSlowPromiseEvent: true
+ firePermissionPromptIsShownEvent: true
})
: [];
})
@@ -651,7 +643,6 @@ export default {
// the user inputs their credentials, but the dialog would be
// overshadowed by the overlay.
tryCreateLocalTracks.then(tracks => {
- APP.store.dispatch(toggleSlowGUMOverlay(false));
APP.store.dispatch(mediaPermissionPromptVisibilityChanged(false));
return tracks;
diff --git a/react/features/base/tracks/functions.ts b/react/features/base/tracks/functions.ts
index 734bbfa3db..7db2eaa635 100644
--- a/react/features/base/tracks/functions.ts
+++ b/react/features/base/tracks/functions.ts
@@ -132,9 +132,6 @@ export async function createLocalPresenterTrack(options: TrackOptions, desktopHe
* @param {boolean} [options.firePermissionPromptIsShownEvent] - Whether lib-jitsi-meet
* should check for a {@code getUserMedia} permission prompt and fire a
* corresponding event.
- * @param {boolean} [options.fireSlowPromiseEvent] - Whether lib-jitsi-meet
- * should check for a slow {@code getUserMedia} request and fire a
- * corresponding event.
* @param {IStore} store - The redux store in the context of which the function
* is to execute and from which state such as {@code config} is to be retrieved.
* @returns {Promise<JitsiLocalTrack[]>}
@@ -145,7 +142,6 @@ export function createLocalTracksF(options: TrackOptions = {}, store?: IStore) {
desktopSharingSourceDevice,
desktopSharingSources,
firePermissionPromptIsShownEvent,
- fireSlowPromiseEvent,
timeout
} = options;
@@ -193,7 +189,6 @@ export function createLocalTracksF(options: TrackOptions = {}, store?: IStore) {
effects,
firefox_fake_device, // eslint-disable-line camelcase
firePermissionPromptIsShownEvent,
- fireSlowPromiseEvent,
micDeviceId,
resolution,
timeout
diff --git a/react/features/base/tracks/types.ts b/react/features/base/tracks/types.ts
index f09c19e88f..121008ec1f 100644
--- a/react/features/base/tracks/types.ts
+++ b/react/features/base/tracks/types.ts
@@ -14,7 +14,6 @@ export interface TrackOptions {
devices?: string[];
facingMode?: string;
firePermissionPromptIsShownEvent?: boolean;
- fireSlowPromiseEvent?: boolean;
micDeviceId?: string | null;
timeout?: number;
}
diff --git a/react/features/overlay/actionTypes.ts b/react/features/overlay/actionTypes.ts
index f441a73ae3..6211b9fd32 100644
--- a/react/features/overlay/actionTypes.ts
+++ b/react/features/overlay/actionTypes.ts
@@ -14,17 +14,6 @@
export const MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED
= 'MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED';
-/**
- * The type of the Redux action which signals that the overlay for slow gUM is visible or not.
- *
- * {
- * type: TOGGLE_SLOW_GUM_OVERLAY,
- * isVisible: {boolean},
- * }
- * @public
- */
-export const TOGGLE_SLOW_GUM_OVERLAY = 'TOGGLE_SLOW_GUM_OVERLAY';
-
/**
* Adjust the state of the fatal error which shows/hides the reload screen. See
* action methods's description for more info about each of the fields.
diff --git a/react/features/overlay/actions.js b/react/features/overlay/actions.js
index b1cf53219f..32b4d70ecc 100644
--- a/react/features/overlay/actions.js
+++ b/react/features/overlay/actions.js
@@ -3,8 +3,7 @@
import {
MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
SET_FATAL_ERROR,
- SET_PAGE_RELOAD_OVERLAY_CANCELED,
- TOGGLE_SLOW_GUM_OVERLAY
+ SET_PAGE_RELOAD_OVERLAY_CANCELED
} from './actionTypes';
/**
@@ -28,24 +27,6 @@ export function mediaPermissionPromptVisibilityChanged(isVisible: boolean, brows
};
}
-/**
- * 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.
- * @public
- * @returns {{
-* type: SLOW_GET_USER_MEDIA_OVERLAY,
-* isVisible: {boolean}
-* }}
-*/
-export function toggleSlowGUMOverlay(isVisible: boolean) {
- return {
- type: TOGGLE_SLOW_GUM_OVERLAY,
- isVisible
- };
-}
-
/**
* The action indicates that an unrecoverable error has occurred and the reload
* screen will be displayed or hidden.
diff --git a/react/features/overlay/components/web/AbstractSlowGUMOverlay.js b/react/features/overlay/components/web/AbstractSlowGUMOverlay.js
deleted file mode 100644
index 736caa82c7..0000000000
--- a/react/features/overlay/components/web/AbstractSlowGUMOverlay.js
+++ /dev/null
@@ -1,33 +0,0 @@
-// @flow
-
-import { Component } from 'react';
-
-/**
- * The type of the React {@code Component} props of
- * {@link AbstractSlowGUMOverlay}.
- */
-type Props = {
-
- /**
- * The function to translate human-readable text.
- */
- t: Function
-};
-
-/**
- * Implements a React {@link Component} for slow gUM overlay. Shown when
- * a slow gUM promise resolution is detected.
- */
-export default class AbstractSlowGUMOverlay extends Component<Props> {
- /**
- * 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: Object) {
- return state['features/overlay'].isSlowGUMOverlayVisible;
- }
-}
diff --git a/react/features/overlay/components/web/SlowGUMOverlay.js b/react/features/overlay/components/web/SlowGUMOverlay.js
deleted file mode 100644
index f4af83eeec..0000000000
--- a/react/features/overlay/components/web/SlowGUMOverlay.js
+++ /dev/null
@@ -1,36 +0,0 @@
-// @flow
-import Spinner from '@atlaskit/spinner';
-import React from 'react';
-
-import { translate } from '../../../base/i18n';
-
-import AbstractSlowGUMOverlay from './AbstractSlowGUMOverlay';
-import OverlayFrame from './OverlayFrame';
-
-/**
- * Implements a React {@link Component} for slow gUM overlay. Shown when
- * a slow gUM promise resolution is detected.
- */
-class SlowGUMOverlay extends AbstractSlowGUMOverlay {
- /**
- * Implements React's {@link Component#render()}.
- *
- * @inheritdoc
- * @returns {ReactElement}
- */
- render() {
- // const { t } = this.props;
-
- return (
- <OverlayFrame>
- <div className = { 'overlay__spinner-container' }>
- <Spinner
- invertColor = { true }
- size = { 'large' } />
- </div>
- </OverlayFrame>
- );
- }
-}
-
-export default translate(SlowGUMOverlay);
diff --git a/react/features/overlay/components/web/index.js b/react/features/overlay/components/web/index.js
index 0a96e7519c..f29b685470 100644
--- a/react/features/overlay/components/web/index.js
+++ b/react/features/overlay/components/web/index.js
@@ -5,4 +5,3 @@ export { default as OverlayFrame } from './OverlayFrame';
export { default as PageReloadOverlay } from './PageReloadOverlay';
export { default as SuspendedOverlay } from './SuspendedOverlay';
export { default as UserMediaPermissionsOverlay } from './UserMediaPermissionsOverlay';
-export { default as SlowGUMOverlay } from './SlowGUMOverlay';
diff --git a/react/features/overlay/overlays.web.js b/react/features/overlay/overlays.web.js
index 4cd70b86fa..20004a915b 100644
--- a/react/features/overlay/overlays.web.js
+++ b/react/features/overlay/overlays.web.js
@@ -2,7 +2,6 @@
import {
PageReloadOverlay,
- SlowGUMOverlay,
SuspendedOverlay,
UserMediaPermissionsOverlay
} from './components/web';
@@ -16,7 +15,6 @@ export function getOverlays(): Array<Object> {
return [
PageReloadOverlay,
SuspendedOverlay,
- UserMediaPermissionsOverlay,
- SlowGUMOverlay
+ UserMediaPermissionsOverlay
];
}
diff --git a/react/features/overlay/reducer.ts b/react/features/overlay/reducer.ts
index 924106b72e..3af45bf286 100644
--- a/react/features/overlay/reducer.ts
+++ b/react/features/overlay/reducer.ts
@@ -4,15 +4,13 @@ import { assign, set } from '../base/redux/functions';
import {
MEDIA_PERMISSION_PROMPT_VISIBILITY_CHANGED,
- SET_FATAL_ERROR,
- TOGGLE_SLOW_GUM_OVERLAY
+ SET_FATAL_ERROR
} from './actionTypes';
export interface IOverlayState {
browser?: string;
fatalError?: Error;
isMediaPermissionPromptVisible?: boolean;
- isSlowGUMOverlayVisible?: boolean;
loadConfigOverlayVisible?: boolean;
}
@@ -35,9 +33,6 @@ ReducerRegistry.register<IOverlayState>('features/overlay', (state = {}, action)
case SET_FATAL_ERROR:
return _setFatalError(state, action);
-
- case TOGGLE_SLOW_GUM_OVERLAY:
- return _toggleSlowGUMOverlay(state, action);
}
return state;
@@ -62,24 +57,6 @@ function _mediaPermissionPromptVisibilityChanged(
});
}
-/**
- * Reduces a specific redux action TOGGLE_SLOW_GUM_OVERLAY 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 _toggleSlowGUMOverlay(
- state: IOverlayState,
- { isVisible }: { isVisible?: boolean; }) {
- return assign(state, {
- isSlowGUMOverlayVisible: isVisible
- });
-}
-
/**
* Sets the {@code LoadConfigOverlay} overlay visible or not.
*