Failed to create a DefaultVideoTransformDevice: TypeError: Converting circular structure to JSON
See original GitHub issueWhat are you trying to do?
I am trying to implement the feature of background blur and background replacement referencing the demo meeting app
https://github.com/aws-samples/amazon-chime-sdk/tree/main/apps/meeting#readme---react-meeting-demo
How can the documentation be improved to help your use case?
The app i am trying to incorporate the feature is in javascript. I am facing the error create a DefaultVideoTransformDevice: TypeError: Converting circular structure to JSON while selecting the background blur or replacement option from the option dropdown.
After trying a lot i found one work around to solve the issue. In index.esm.js file when we pass the 2nd argument a replacer function in JSON.stringify it works. Please refer the below code (createBackgroundBlurDevice function) for clear understanding
current code: 1.console.log("Calling createBackgroundBlurDevice with device: " + JSON.stringify(selectedDevice));
2. console.log("Created video transform device " + JSON.stringify(chosenVideoTransformDevice, null, 2));
Replaced with : 1. console.log("Calling createBackgroundBlurDevice with device: " + JSON.stringify(selectedDevice,replacerFunc()));
2.console.log("Created video transform device " + JSON.stringify(chosenVideoTransformDevice, replacerFunc()));
replacer functuion adding after base spacing function:
var replacerFunc = function() {
const visited = new WeakSet();
return (key, value) => {
if (typeof value === "object" && value !== null) {
if (visited.has(value)) {
return;
}
visited.add(value);
}
return value;
};
};
Also same things changed in createBackgroundReplacementDevice function do the work for background replacement
What documentation have you looked at so far?
Amazon Chime SDK React Components Library GitHub React SDK meeting demo Amazon Chime SDK React Components Library GitHub issues
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top GitHub Comments
@ltrung Thanks for the confirmation.
I can see that update is only merged in github but not updated in NPM package amazon-chime-sdk-component-library-react. could you please help me by releasing the same update in NPM package also.
I have the same problem🙈