-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
173 lines (169 loc) · 7.11 KB
/
index.html
File metadata and controls
173 lines (169 loc) · 7.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Facebook Videos</title>
<script>
// JavaScript to refresh the page every 10 seconds
setTimeout(() => {
window.location.reload();
}, 60000); // 10 seconds
// Lazy load function to load video when visible
document.addEventListener("DOMContentLoaded", function () {
const videos = document.querySelectorAll('.fb-video');
const observer = new IntersectionObserver((entries, observer) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
const iframe = entry.target;
iframe.src = iframe.dataset.src; // Load the video iframe source
observer.unobserve(entry.target); // Stop observing once loaded
}
});
}, { threshold: 0.5 }); // Trigger when 50% of the video is visible
videos.forEach(video => {
observer.observe(video);
});
});
</script>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
background-color: #f9f9f9;
}
.video-container {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 20px;
margin: 20px;
}
.video {
max-width: 100px;
width: 100%;
aspect-ratio:1/1;
position: relative;
}
.loading-spinner {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 18px;
color: #333;
}
</style>
</head>
<body>
<h1>Facebook Video Autoplay</h1>
<div class="video-container">
<!-- Embed the same video 10 times -->
<div class="video">
<div class="loading-spinner">Loading...</div>
<iframe class="fb-video"
data-src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Fsimaykoo%2Fvideos%2F1288514738824505&autoplay=1"
width="500" height="280"
style="border:none;overflow:hidden"
scrolling="no" frameborder="0"
allowfullscreen="true">
</iframe>
</div>
<div class="video">
<div class="loading-spinner">Loading...</div>
<iframe class="fb-video"
data-src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Fsimaykoo%2Fvideos%2F1288514738824505&autoplay=1"
width="500" height="280"
style="border:none;overflow:hidden"
scrolling="no" frameborder="0"
allowfullscreen="true">
</iframe>
</div>
<div class="video">
<div class="loading-spinner">Loading...</div>
<iframe class="fb-video"
data-src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Fsimaykoo%2Fvideos%2F1288514738824505&autoplay=1"
width="500" height="280"
style="border:none;overflow:hidden"
scrolling="no" frameborder="0"
allowfullscreen="true">
</iframe>
</div>
<div class="video">
<div class="loading-spinner">Loading...</div>
<iframe class="fb-video"
data-src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Fsimaykoo%2Fvideos%2F1288514738824505&autoplay=1"
width="500" height="280"
style="border:none;overflow:hidden"
scrolling="no" frameborder="0"
allowfullscreen="true">
</iframe>
</div>
<div class="video">
<div class="loading-spinner">Loading...</div>
<iframe class="fb-video"
data-src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Fsimaykoo%2Fvideos%2F1288514738824505&autoplay=1"
width="500" height="280"
style="border:none;overflow:hidden"
scrolling="no" frameborder="0"
allowfullscreen="true">
</iframe>
</div>
<div class="video">
<div class="loading-spinner">Loading...</div>
<iframe class="fb-video"
data-src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Fsimaykoo%2Fvideos%2F1288514738824505&autoplay=1"
width="500" height="280"
style="border:none;overflow:hidden"
scrolling="no" frameborder="0"
allowfullscreen="true">
</iframe>
</div>
<div class="video">
<div class="loading-spinner">Loading...</div>
<iframe class="fb-video"
data-src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Fsimaykoo%2Fvideos%2F1288514738824505&autoplay=1"
width="500" height="280"
style="border:none;overflow:hidden"
scrolling="no" frameborder="0"
allowfullscreen="true">
</iframe>
</div>
<div class="video">
<div class="loading-spinner">Loading...</div>
<iframe class="fb-video"
data-src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Fsimaykoo%2Fvideos%2F1288514738824505&autoplay=1"
width="500" height="280"
style="border:none;overflow:hidden"
scrolling="no" frameborder="0"
allowfullscreen="true">
</iframe>
</div>
<div class="video">
<div class="loading-spinner">Loading...</div>
<iframe class="fb-video"
data-src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Fsimaykoo%2Fvideos%2F1288514738824505&autoplay=1"
width="500" height="280"
style="border:none;overflow:hidden"
scrolling="no" frameborder="0"
allowfullscreen="true">
</iframe>
</div>
<div class="video">
<div class="loading-spinner">Loading...</div>
<iframe class="fb-video"
data-src="https://www.facebook.com/plugins/video.php?href=https%3A%2F%2Fwww.facebook.com%2Fsimaykoo%2Fvideos%2F1288514738824505&autoplay=1"
width="500" height="280"
style="border:none;overflow:hidden"
scrolling="no" frameborder="0"
allowfullscreen="true">
</iframe>
</div>
</div>
<!-- Facebook SDK -->
<div id="fb-root"></div>
<script async defer crossorigin="anonymous"
src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v17.0"
nonce="Fb2mKGY8"></script>
</body>
</html>