Skip to content

Commit 3b650de

Browse files
committed
fix: resolve video loading error
1 parent c0cbb8a commit 3b650de

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

components/footer/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ const Footer = async () => {
102102
Privacy Policy
103103
</FooterLink>
104104
<div>|</div>
105-
<div>Copyright © 2024 Fumadocs. All rights reserved.</div>
105+
<div>Copyright © 2024 Sailos. All rights reserved.</div>
106106
</div>
107107
<div className="flex space-x-4">
108108
<Link

components/header/video.tsx

+8-16
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,8 @@ export default function Video() {
88
const [isPlaying, setIsPlaying] = useState(false);
99
const playerRef = useRef<ReactPlayer>(null);
1010

11-
const handlePlay = () => {
12-
setIsPlaying(true);
13-
playerRef.current?.seekTo(0);
14-
};
15-
16-
useEffect(() => {
17-
if (playerRef.current) {
18-
playerRef.current.getInternalPlayer()?.load();
19-
}
20-
}, []);
21-
2211
return (
23-
<div className="relative w-full mt-20">
12+
<div className="relative mt-20 w-full">
2413
<div className="relative z-20 mx-auto max-w-[1000px] px-4">
2514
<AnimateElement type="slideUp" delay={0.2} duration={0.6}>
2615
<div className="aspect-video w-full">
@@ -31,18 +20,21 @@ export default function Video() {
3120
height="100%"
3221
playing={isPlaying}
3322
controls={true}
23+
onReady={() => {
24+
console.log('Video is ready to play');
25+
}}
3426
config={{
3527
youtube: {
3628
playerVars: {
3729
modestbranding: 1,
38-
rel: 0
39-
}
40-
}
30+
rel: 0,
31+
},
32+
},
4133
}}
4234
/>
4335
</div>
4436
</AnimateElement>
4537
</div>
4638
</div>
4739
);
48-
}
40+
}

components/ui/animated-wrapper.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const AnimateElement: React.FC<AnimateElementProps> = ({
2424
children,
2525
type,
2626
delay = 0.2,
27-
duration = 0.6,
27+
duration = 0.4,
2828
className,
2929
}) => {
3030
const ref = useRef(null);

0 commit comments

Comments
 (0)