video on hover

CODE JS A AJOUTER

 

const videos = document.querySelectorAll(".pp-video-player");

videos.forEach(video => {
video.addEventListener("mouseenter", () => {
video.play();
const hoverText = video.nextElementSibling; // Si le texte est juste après la vidéo
if (hoverText && hoverText.classList.contains("active")) {
hoverText.classList.remove("active");
}
});

video.addEventListener("mouseleave", () => {
video.pause();
const hoverText = video.nextElementSibling;
if (hoverText) {
hoverText.classList.add("active");
}
});
});