Skip to content

Commit

Permalink
ref(join) remove overlay shown for a slow gUM flow (jitsi#12268)
Browse files Browse the repository at this point in the history
  • Loading branch information
quitrk authored Sep 29, 2022
1 parent c523c07 commit 3c180d3
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 147 deletions.
17 changes: 4 additions & 13 deletions conference.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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 ?
Expand Down Expand Up @@ -585,8 +579,7 @@ export default {
tryCreateLocalTracks = createLocalTracksF({
devices: initialDevices,
timeout,
firePermissionPromptIsShownEvent: true,
fireSlowPromiseEvent: true
firePermissionPromptIsShownEvent: true
})
.catch(err => {
if (requestedAudio && requestedVideo) {
Expand Down Expand Up @@ -629,8 +622,7 @@ export default {
return requestedVideo
? createLocalTracksF({
devices: [ MEDIA_TYPE.VIDEO ],
firePermissionPromptIsShownEvent: true,
fireSlowPromiseEvent: true
firePermissionPromptIsShownEvent: true
})
: [];
})
Expand All @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions react/features/base/tracks/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[]>}
Expand All @@ -145,7 +142,6 @@ export function createLocalTracksF(options: TrackOptions = {}, store?: IStore) {
desktopSharingSourceDevice,
desktopSharingSources,
firePermissionPromptIsShownEvent,
fireSlowPromiseEvent,
timeout
} = options;

Expand Down Expand Up @@ -193,7 +189,6 @@ export function createLocalTracksF(options: TrackOptions = {}, store?: IStore) {
effects,
firefox_fake_device, // eslint-disable-line camelcase
firePermissionPromptIsShownEvent,
fireSlowPromiseEvent,
micDeviceId,
resolution,
timeout
Expand Down
1 change: 0 additions & 1 deletion react/features/base/tracks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ export interface TrackOptions {
devices?: string[];
facingMode?: string;
firePermissionPromptIsShownEvent?: boolean;
fireSlowPromiseEvent?: boolean;
micDeviceId?: string | null;
timeout?: number;
}
11 changes: 0 additions & 11 deletions react/features/overlay/actionTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
21 changes: 1 addition & 20 deletions react/features/overlay/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand All @@ -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.
Expand Down
33 changes: 0 additions & 33 deletions react/features/overlay/components/web/AbstractSlowGUMOverlay.js

This file was deleted.

36 changes: 0 additions & 36 deletions react/features/overlay/components/web/SlowGUMOverlay.js

This file was deleted.

1 change: 0 additions & 1 deletion react/features/overlay/components/web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
4 changes: 1 addition & 3 deletions react/features/overlay/overlays.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import {
PageReloadOverlay,
SlowGUMOverlay,
SuspendedOverlay,
UserMediaPermissionsOverlay
} from './components/web';
Expand All @@ -16,7 +15,6 @@ export function getOverlays(): Array<Object> {
return [
PageReloadOverlay,
SuspendedOverlay,
UserMediaPermissionsOverlay,
SlowGUMOverlay
UserMediaPermissionsOverlay
];
}
25 changes: 1 addition & 24 deletions react/features/overlay/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
Expand All @@ -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.
*
Expand Down

0 comments on commit 3c180d3

Please sign in to comment.