Spaces:
Running
Running
video does not play on mobile safari and chrome - Follow Up Deployment
Browse files- index.html +16 -1
index.html
CHANGED
@@ -59,8 +59,9 @@
|
|
59 |
|
60 |
<!-- Video Background -->
|
61 |
<div class="fixed inset-0 -z-10 overflow-hidden">
|
62 |
-
<video autoplay loop playsinline class="w-full h-full object-cover">
|
63 |
<source src="https://huggingface.co/spaces/akhaliq/nexusrobotics/resolve/main/Video_of_Robot_Washing_Dishes.mp4" type="video/mp4">
|
|
|
64 |
</video>
|
65 |
<div class="absolute inset-0 bg-black/30"></div>
|
66 |
</div>
|
@@ -118,6 +119,20 @@
|
|
118 |
</section>
|
119 |
|
120 |
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
// Simple animation for the join button
|
122 |
document.querySelectorAll('.join-btn').forEach(button => {
|
123 |
button.addEventListener('mouseenter', () => {
|
|
|
59 |
|
60 |
<!-- Video Background -->
|
61 |
<div class="fixed inset-0 -z-10 overflow-hidden">
|
62 |
+
<video autoplay loop playsinline muted class="w-full h-full object-cover">
|
63 |
<source src="https://huggingface.co/spaces/akhaliq/nexusrobotics/resolve/main/Video_of_Robot_Washing_Dishes.mp4" type="video/mp4">
|
64 |
+
<img src="fallback-image.jpg" alt="Nexus Robotics" class="w-full h-full object-cover">
|
65 |
</video>
|
66 |
<div class="absolute inset-0 bg-black/30"></div>
|
67 |
</div>
|
|
|
119 |
</section>
|
120 |
|
121 |
<script>
|
122 |
+
// Video autoplay fallback
|
123 |
+
document.addEventListener('DOMContentLoaded', function() {
|
124 |
+
const video = document.querySelector('video');
|
125 |
+
const playPromise = video.play();
|
126 |
+
|
127 |
+
if (playPromise !== undefined) {
|
128 |
+
playPromise.catch(error => {
|
129 |
+
video.style.display = 'none';
|
130 |
+
const fallbackImg = video.querySelector('img');
|
131 |
+
if (fallbackImg) fallbackImg.style.display = 'block';
|
132 |
+
});
|
133 |
+
}
|
134 |
+
});
|
135 |
+
|
136 |
// Simple animation for the join button
|
137 |
document.querySelectorAll('.join-btn').forEach(button => {
|
138 |
button.addEventListener('mouseenter', () => {
|