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

updated foregroundOverlay for webkitbased browsers #56

Merged
merged 1 commit into from
Jan 27, 2022
Merged
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
23 changes: 15 additions & 8 deletions react/features/base/tracks/loadEffects.web.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import { createForegroundOverlay } from '../../stream-effects/foreground-overlay';
import { createVirtualBackgroundEffect } from '../../stream-effects/virtual-background';
import { browser } from '../lib-jitsi-meet';

import logger from './logger';

Expand All @@ -14,8 +15,11 @@ import logger from './logger';
export default function loadEffects(store: Object): Promise<any> {
const state = store.getState();
const virtualBackground = state['features/virtual-background'];

const foregroundOverlay = state['features/foreground-overlay'];

const safariBrowser = browser.isWebKitBased();

const backgroundPromise = virtualBackground.backgroundEffectEnabled
? createVirtualBackgroundEffect(virtualBackground)
.catch(error => {
Expand All @@ -24,18 +28,21 @@ export default function loadEffects(store: Object): Promise<any> {
return Promise.resolve();
})
: Promise.resolve();
const foregroundOverlayPromise = foregroundOverlay

const foregroundOverlayPromise = safariBrowser ? null : foregroundOverlay
? createForegroundOverlay(
foregroundOverlay?.overlayImageUrl,
foregroundOverlay?.overlayColor,
foregroundOverlay?.mode
foregroundOverlay?.overlayImageUrl,
foregroundOverlay?.overlayColor,
foregroundOverlay?.mode
)
.catch(error => {
logger.error('Failed to obtain the foreground overlay effect instance with error: ', error);
.catch(error => {
logger.error('Failed to obtain the foreground overlay effect instance with error: ', error);

return Promise.resolve();
})
return Promise.resolve();
})
: Promise.resolve();


return Promise.all([ backgroundPromise, foregroundOverlayPromise ]);

}