|
|
|
@ -95,6 +95,8 @@ function Video({ sourceBase, hidden }: {
|
|
|
|
const videoRef = useRef<HTMLVideoElement>(null);
|
|
|
|
const videoRef = useRef<HTMLVideoElement>(null);
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
|
|
|
|
if (!videoRef.current || hidden) return;
|
|
|
|
|
|
|
|
console.log('effect running running and running running')
|
|
|
|
const handleScroll = () => {
|
|
|
|
const handleScroll = () => {
|
|
|
|
if (!videoRef.current || hidden) return;
|
|
|
|
if (!videoRef.current || hidden) return;
|
|
|
|
|
|
|
|
|
|
|
|
@ -106,7 +108,7 @@ function Video({ sourceBase, hidden }: {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const throttledHandleScroll = () => {
|
|
|
|
const throttledHandleScroll = () => {
|
|
|
|
requestAnimationFrame(handleScroll);
|
|
|
|
// requestAnimationFrame(handleScroll);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
window.addEventListener("scroll", throttledHandleScroll);
|
|
|
|
window.addEventListener("scroll", throttledHandleScroll);
|
|
|
|
|