allow=âautoplay; camera; microphone; fullscreen; picture-in-picture; display-capture; midi; geolocation;â
src=âhttps://www.publicmusic.it/ninja/?room=Publicmusic&autogain=1&echocancellation=1&record=1000&transparent&proaudio=4&zoom=0&easyexit&muted&mutespeakerâ
width=â100%â
height=â800â³
frameborder=â0â³>
// Simulazione click nellâiframe
const iframeId = âninjaIframeâ;
let retryCount = 0;
const maxRetries = 10;
function checkIframePresence() {
const iframe = document.getElementById(iframeId);
if (iframe && iframe.contentWindow) {
handleIframeLoad(iframe);
return;
}
retryCount++;
if (retryCount
setTimeout(checkIframePresence, 1000);
}
}
function handleIframeLoad(iframe) {
try {
const iframeContent = iframe.contentWindow.document;
const containerButton = iframeContent.querySelector(â#container-3 buttonâ);
const gowebcamButton = iframeContent.querySelector(â#gowebcamâ);
if (containerButton) {
containerButton.click();
}
if (gowebcamButton && gowebcamButton.offsetParent !== null && !gowebcamButton.disabled) {
gowebcamButton.click();
} else {
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (mutation.type === âattributesâ && mutation.target === gowebcamButton) {
if (gowebcamButton.offsetParent !== null && !gowebcamButton.disabled) {
gowebcamButton.click();
observer.disconnect();
}
}
});
});
observer.observe(gowebcamButton, { attributes: true });
}
} catch (error) {
// Silenziato
}
}
checkIframePresence();
});