If the Embed recorder is not working on your site, such as Wix or Webflow, please follow the following steps.
Usually, websites like Wix or Webflow remove the Microphone and Camera permission which creates an issue for a recorder on any browser.
Please include the below script to include the permission in your iFrame dynamically.
<script>
function addPermissions(iframe) {
const ALLOW_PERMISSIONS = 'camera; microphone; fullscreen; display-capture';
if (iframe.allow === ALLOW_PERMISSIONS) { return }
iframe.setAttribute('allow', ALLOW_PERMISSIONS)
iframe.allow = ALLOW_PERMISSIONS
iframe.src = iframe.src
}
document.querySelectorAll('iframe').forEach(addPermissions);
const observer = new MutationObserver((mutationsList, observer) => {
for (let mutation of mutationsList) {
if (mutation.addedNodes && mutation.addedNodes.length) {
for (let node of mutation.addedNodes) {
if (node.querySelectorAll) {
node.querySelectorAll('iframe').forEach(addPermissions)
}
}
}
}
})
observer.observe(document.body, { attributes: false, childList: true, subtree: true })
</script>
Please ensure to include the above script to End of the Body to include the permission to all the iFrames on the page.
For Wix:
Here're a few steps to follow for the Wix website.
β
Go to Settings and scroll to Advanced (the last section), and you can see Custom Code.
β
Include the script
code under the body - END
option.
β
That will ask you to apply on all the pages or specific pages.