Browse Source

change typo autoplay

master
azri 1 week ago
parent
commit
8085d5f233
1 changed files with 5 additions and 7 deletions
  1. 5
    7
      src/components/VideoAds/VideoAds.jsx

+ 5
- 7
src/components/VideoAds/VideoAds.jsx View File

9
 
9
 
10
   useEffect(() => {
10
   useEffect(() => {
11
     if (videoRef.current) {
11
     if (videoRef.current) {
12
-
12
+      
13
       videoRef.current.muted = true; // Ensure video starts muted for autoplay
13
       videoRef.current.muted = true; // Ensure video starts muted for autoplay
14
-      setTimeout(() => {
15
-        videoRef.current.play().catch((err) => {
16
-          console.warn('Autoplay failed:', err);
17
-        });
18
-      }, 1000);
14
+      videoRef.current.play().catch((err) => {
15
+        console.warn('Autoplay failed:', err);
16
+      });
19
     }
17
     }
20
   }, []);
18
   }, []);
21
 
19
 
44
       <video
42
       <video
45
         ref={videoRef}
43
         ref={videoRef}
46
         src={video_url || videoAds}
44
         src={video_url || videoAds}
47
-        autoPlay
45
+        autoplay
48
         loop
46
         loop
49
         muted={isMuted}
47
         muted={isMuted}
50
         playsInline
48
         playsInline

Loading…
Cancel
Save