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