video player ėėą
ėĪė ė―ëë githubė ėŽëĶž(wetube_v2)
ðĄ Mouse Events - mousemove / mouseleave
// videoPlayer.js let videoPlayerTimeout = null; let videoPlayerMovementTimeout = null; const hideVideoPlayer = () => videoPlayer.classList.remove("showing"); const handleMouseMove = () => { if (videoPlayerTimeout) { clearTimeout(videoPlayerTimeout); videoPlayerTimeout = null; } if (videoPlayerMovementTimeout) { clearTimeout(videoPlayerMovementTimeout); videoPlayerMovementTimeout = null; } videoPlayer.classList.add("showing"); videoPlayerMovementTimeout = setTimeout(hideVideoPlayer, 3000); }; const handleMouseLeave = () => { videoPlayerTimeout = setTimeout(hideVideoPlayer, 3000); }; video.addEventListener("mousemove", handleMouseMove); video.addEventListener("mouseleave", handleMouseLeave);