Open risingmax123456 opened 1 month ago
follow same documentation still facing issue
@risingmax123456 You should use local absolute path of the custom background image.
i am using this to get absolute path still having issue
export async function getAbsolutePath(filePath) {
if (Platform.OS === 'android') {
if (filePath.startsWith('/assets/')) {
const fileName = filePath.replace('/assets/', '');
const destPath = ${ExternalCachesDirectoryPath}/${fileName}
;
if (!(await exists(destPath))) {
await copyFileAssets(fileName, destPath);
}
return destPath;
}
}
return filePath;
}
Any update ?
@risingmax123456 Can you try to install the demo in your phone? It works fine to me. You can refer to the image configuration and code of the demo in https://github.com/AgoraIO-Extensions/react-native-agora/blob/main/example/src/examples/advanced/VirtualBackground/VirtualBackground.tsx#L132
Describe the bug Virtual background for image is not working receiving error -2 in console
To Reproduce Steps to reproduce the behavior: implement agora with group video call and set a image virtual background
Expected behavior Virtual background should work
Code using
let backgroundSourceType = BackgroundSourceType.BackgroundImg; let source = 'https://jamme3na.blob.core.windows.net/jamme3na/001A00AD-630C-44FB-8054-6826F02C1564.jpg'; const result = agoraEngine?.enableVirtualBackground( true, { background_source_type: backgroundSourceType, source: source, }, {}, ); if (result !== 0) { console.error('Failed to set virtual background. Error code:', result); }
please help