IA nas Eleições: o papel da sociedade na fiscalização do mau uso da IA

junho 8, 2024 0 Por Editor

function hideMask(element){

let control = element.parentNode.parentNode.previousElementSibling
control.style.display = ‘none’

}

controls = document.querySelectorAll(“.controls button”)

controls.forEach(control => {

control.onclick = () => {
// debugger;
// Get the video player element
let video = control.closest(“.mw-article-video”).querySelector(“iframe”);

if (control.closest(“.mw-article-video”).querySelector(“.fb-video”)) {
hideMask(video);
video.src = document.querySelector(‘.fb-video-container’).dataset[‘source’];
video.onload = () => {
document.querySelector(‘.fb-video-container’).style.display = ‘block’;
}
delete document.querySelector(‘.fb-video-container’).dataset[‘source’];
} else if (control.closest(“.mw-article-video”).querySelector(“video”)) {
video = control.closest(“.mw-article-video”).querySelector(“video”);
hideMask(video);
video.closest(‘.media.interno’).style.display = ‘flex’;
video.play()
} else {
// Load the video content
video.onload = () => {
hideMask(video);
}
video.src = video.dataset[‘source’];
// Delete data-source attribute
delete video.dataset[‘source’];
}

}
});