fix(blur): when switching video tracks.
This commit is contained in:
parent
8f79779ca7
commit
f030a3f1fb
|
@ -106,7 +106,6 @@ import {
|
|||
trackRemoved
|
||||
} from './react/features/base/tracks';
|
||||
import { getJitsiMeetGlobalNS } from './react/features/base/util';
|
||||
import { getBlurEffect } from './react/features/blur';
|
||||
import { addMessage } from './react/features/chat';
|
||||
import { showDesktopPicker } from './react/features/desktop-picker';
|
||||
import { appendSuffix } from './react/features/display-name';
|
||||
|
@ -560,22 +559,7 @@ export default {
|
|||
// Resolve with no tracks
|
||||
tryCreateLocalTracks = Promise.resolve([]);
|
||||
} else {
|
||||
const loadEffectsPromise = options.startWithBlurEnabled
|
||||
? getBlurEffect()
|
||||
.then(blurEffect => [ blurEffect ])
|
||||
.catch(error => {
|
||||
logger.error('Failed to obtain the blur effect instance with error: ', error);
|
||||
|
||||
return Promise.resolve([]);
|
||||
})
|
||||
: Promise.resolve([]);
|
||||
|
||||
tryCreateLocalTracks = loadEffectsPromise.then(trackEffects =>
|
||||
createLocalTracksF(
|
||||
{
|
||||
devices: initialDevices,
|
||||
effects: trackEffects
|
||||
}, true)
|
||||
tryCreateLocalTracks = createLocalTracksF({ devices: initialDevices }, true)
|
||||
.catch(err => {
|
||||
if (requestedAudio && requestedVideo) {
|
||||
|
||||
|
@ -615,8 +599,7 @@ export default {
|
|||
videoOnlyError = err;
|
||||
|
||||
return [];
|
||||
})
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// Hide the permissions prompt/overlay as soon as the tracks are
|
||||
|
@ -678,7 +661,6 @@ export default {
|
|||
'initial device list initialization failed', error))
|
||||
.then(() => this.createInitialLocalTracksAndConnect(
|
||||
options.roomName, {
|
||||
startWithBlurEnabled: APP.store.getState()['features/blur'].blurEnabled,
|
||||
startAudioOnly: config.startAudioOnly,
|
||||
startScreenSharing: config.startScreenSharing,
|
||||
startWithAudioMuted: config.startWithAudioMuted || config.startSilent,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/* global APP */
|
||||
|
||||
import { getBlurEffect } from '../../blur';
|
||||
import JitsiMeetJS, { JitsiTrackErrors } from '../lib-jitsi-meet';
|
||||
import { MEDIA_TYPE } from '../media';
|
||||
import {
|
||||
|
@ -50,14 +51,25 @@ export function createLocalTracksF(
|
|||
}
|
||||
}
|
||||
|
||||
const state = store.getState();
|
||||
const {
|
||||
constraints,
|
||||
desktopSharingFrameRate,
|
||||
firefox_fake_device, // eslint-disable-line camelcase
|
||||
resolution
|
||||
} = store.getState()['features/base/config'];
|
||||
} = state['features/base/config'];
|
||||
const loadEffectsPromise = state['features/blur'].blurEnabled
|
||||
? getBlurEffect()
|
||||
.then(blurEffect => [ blurEffect ])
|
||||
.catch(error => {
|
||||
logger.error('Failed to obtain the blur effect instance with error: ', error);
|
||||
|
||||
return Promise.resolve([]);
|
||||
})
|
||||
: Promise.resolve([]);
|
||||
|
||||
return (
|
||||
loadEffectsPromise.then(effects =>
|
||||
JitsiMeetJS.createLocalTracks(
|
||||
{
|
||||
cameraDeviceId,
|
||||
|
@ -71,7 +83,7 @@ export function createLocalTracksF(
|
|||
|
||||
// Copy array to avoid mutations inside library.
|
||||
devices: options.devices.slice(0),
|
||||
effects: options.effects,
|
||||
effects,
|
||||
firefox_fake_device, // eslint-disable-line camelcase
|
||||
micDeviceId,
|
||||
resolution
|
||||
|
@ -81,7 +93,7 @@ export function createLocalTracksF(
|
|||
logger.error('Failed to create local tracks', options.devices, err);
|
||||
|
||||
return Promise.reject(err);
|
||||
}));
|
||||
})));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue