Media Devices loop my code

I’ve been working to make a VideoSDK web app, I’m using the purejs sample app as a template, however it was a Node.js program which I can’t use as a web site integration, but I did some minor changes while leaving the code almost untouched. if you read them side to side it’s the same but instead of using local files I’m using the CDN SDK for both the API and the “jrsrasign” there was one file I left out called " " because it opened a localhost with the code to run it
So the problem is when I open the code locally or on my website i get this error messages
“Error toggling video preview Error: videoNotStartedError”
“Uncaught (in promise) Error: VideoNotStartedError”
“{type: ‘invalid_operation’, reason: ‘duplicated opertation’}”
“Error joining session listener: Cannot read properties of undefined (reading 'startAudio)”
brief explanation: after i attemp to join the meeting the mic permission pop up throws me back to the preview screen and locks me there if I turn the camera on during the first preview screen it wil get stuck in off mode after I get thrown into the second preview screen and when I enter the meeting for a second time it stays stuck in the loading screen

Now why I’m I building it like this? because I want to load it into a web builder built site which doesn’t allow me to run nodes
I would have uploaded pictures but it didn’t allow me

@axel.ojeda ,

would this sample code help?

This will run on javascript, html and css without requiring node.
However, you will need to generate your signature securely on a server nonetheless