rn,tracks: do not load stream effects on mobile
This commit is contained in:
parent
385669cbb8
commit
c05b4a43e8
|
@ -1,7 +1,5 @@
|
|||
/* global APP */
|
||||
|
||||
import { createScreenshotCaptureEffect } from '../../stream-effects/screenshot-capture';
|
||||
import { getBlurEffect } from '../../blur';
|
||||
import JitsiMeetJS, { JitsiTrackErrors, browser } from '../lib-jitsi-meet';
|
||||
import { MEDIA_TYPE } from '../media';
|
||||
import {
|
||||
|
@ -9,6 +7,7 @@ import {
|
|||
getUserSelectedMicDeviceId
|
||||
} from '../settings';
|
||||
|
||||
import loadEffects from './loadEffects';
|
||||
import logger from './logger';
|
||||
|
||||
/**
|
||||
|
@ -94,29 +93,10 @@ export function createLocalTracksF(options = {}, firePermissionPromptIsShownEven
|
|||
firefox_fake_device, // eslint-disable-line camelcase
|
||||
resolution
|
||||
} = state['features/base/config'];
|
||||
const constraints = options.constraints
|
||||
?? state['features/base/config'].constraints;
|
||||
|
||||
const blurPromise = state['features/blur'].blurEnabled
|
||||
? getBlurEffect()
|
||||
.catch(error => {
|
||||
logger.error('Failed to obtain the blur effect instance with error: ', error);
|
||||
|
||||
return Promise.resolve();
|
||||
})
|
||||
: Promise.resolve();
|
||||
const screenshotCapturePromise = state['features/screenshot-capture']?.capturesEnabled
|
||||
? createScreenshotCaptureEffect(state)
|
||||
.catch(error => {
|
||||
logger.error('Failed to obtain the screenshot capture effect effect instance with error: ', error);
|
||||
|
||||
return Promise.resolve();
|
||||
})
|
||||
: Promise.resolve();
|
||||
const loadEffectsPromise = Promise.all([ blurPromise, screenshotCapturePromise ]);
|
||||
const constraints = options.constraints ?? state['features/base/config'].constraints;
|
||||
|
||||
return (
|
||||
loadEffectsPromise.then(effectsArray => {
|
||||
loadEffects(store).then(effectsArray => {
|
||||
// Filter any undefined values returned by Promise.resolve().
|
||||
const effects = effectsArray.filter(effect => Boolean(effect));
|
||||
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
// @flow
|
||||
|
||||
/**
|
||||
* Loads the enabled stream effects.
|
||||
*
|
||||
* @param {Object} store - The Redux store.
|
||||
* @returns {Promsie} - A Promise which resolves when all effects are created.
|
||||
*/
|
||||
export default function loadEffects(store: Object): Promise<any> { // eslint-disable-line no-unused-vars
|
||||
return Promise.resolve();
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
// @flow
|
||||
|
||||
import { createScreenshotCaptureEffect } from '../../stream-effects/screenshot-capture';
|
||||
import { getBlurEffect } from '../../blur';
|
||||
|
||||
import logger from './logger';
|
||||
|
||||
/**
|
||||
* Loads the enabled stream effects.
|
||||
*
|
||||
* @param {Object} store - The Redux store.
|
||||
* @returns {Promsie} - A Promise which resolves when all effects are created.
|
||||
*/
|
||||
export default function loadEffects(store: Object): Promise<any> {
|
||||
const state = store.getState();
|
||||
|
||||
const blurPromise = state['features/blur'].blurEnabled
|
||||
? getBlurEffect()
|
||||
.catch(error => {
|
||||
logger.error('Failed to obtain the blur effect instance with error: ', error);
|
||||
|
||||
return Promise.resolve();
|
||||
})
|
||||
: Promise.resolve();
|
||||
const screenshotCapturePromise = state['features/screenshot-capture']?.capturesEnabled
|
||||
? createScreenshotCaptureEffect(state)
|
||||
.catch(error => {
|
||||
logger.error('Failed to obtain the screenshot capture effect effect instance with error: ', error);
|
||||
|
||||
return Promise.resolve();
|
||||
})
|
||||
: Promise.resolve();
|
||||
|
||||
return Promise.all([ blurPromise, screenshotCapturePromise ]);
|
||||
}
|
Loading…
Reference in New Issue