yangjie #49
|
|
@ -125,23 +125,25 @@ export const agora = {
|
|||
if (settingData.darkLightEnhancement) agora.setLowlightEnhanceOptions(settingData.darkLightEnhancement.isDarkLightEnhancement, settingData.darkLightEnhancement)
|
||||
if (settingData.virtualBackground) {
|
||||
if (typeof settingData.virtualBackground.sourceIndex === 'number') {
|
||||
if (window.electron.getEnv() === 'development') {
|
||||
window.electron.getAppPath().then((res: string) => {
|
||||
const imagePath = path.join(res, 'src', 'assets', 'virtualBackground', `${settingData.virtualBackground.sourceIndex + 1}.png`);
|
||||
window.electron.getEnv().then(res => {
|
||||
if (res === 'development') {
|
||||
window.electron.getAppPath().then((res: string) => {
|
||||
const imagePath = path.join(res, 'src', 'assets', 'virtualBackground', `${settingData.virtualBackground.sourceIndex + 1}.png`);
|
||||
agora.enableVirtualBackground(settingData.virtualBackground.isVirtualBackground, {
|
||||
source: imagePath,
|
||||
background_source_type: 2,
|
||||
color: Number(settingData.virtualBackground.color),
|
||||
})
|
||||
})
|
||||
} else {
|
||||
const imagePath = path.join((process as any).resourcesPath, 'images', `${settingData.virtualBackground.sourceIndex + 1}.png`);
|
||||
agora.enableVirtualBackground(settingData.virtualBackground.isVirtualBackground, {
|
||||
source: imagePath,
|
||||
background_source_type: 2,
|
||||
color: Number(settingData.virtualBackground.color),
|
||||
})
|
||||
})
|
||||
} else {
|
||||
const imagePath = path.join((process as any).resourcesPath, 'images', `${settingData.virtualBackground.sourceIndex + 1}.png`);
|
||||
agora.enableVirtualBackground(settingData.virtualBackground.isVirtualBackground, {
|
||||
source: imagePath,
|
||||
background_source_type: 2,
|
||||
color: Number(settingData.virtualBackground.color),
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
agora.enableVirtualBackground(settingData.virtualBackground.isVirtualBackground, {
|
||||
background_source_type: 1,
|
||||
|
|
|
|||
Loading…
Reference in New Issue