|
73 | 73 | <script src="./static/js/bulma-carousel.min.js"></script> |
74 | 74 | <script src="./static/js/bulma-slider.min.js"></script> |
75 | 75 | <script src="./static/js/index.js"></script> |
| 76 | + <script> |
| 77 | + document.addEventListener('DOMContentLoaded', function() { |
| 78 | + var heroVideo = document.querySelector('.hero-video video'); |
| 79 | + if (heroVideo) { |
| 80 | + heroVideo.load(); |
| 81 | + |
| 82 | + var playPromise = heroVideo.play(); |
| 83 | + if (playPromise !== undefined) { |
| 84 | + playPromise.catch(function(error) { |
| 85 | + console.log('Video auto-play failed, will play on user interaction:', error); |
| 86 | + document.addEventListener('touchstart', function playVideoOnce() { |
| 87 | + heroVideo.play().catch(function(e) { |
| 88 | + console.log('Video playback failed:', e); |
| 89 | + }); |
| 90 | + document.removeEventListener('touchstart', playVideoOnce); |
| 91 | + }, { once: true }); |
| 92 | + }); |
| 93 | + } |
| 94 | + |
| 95 | + heroVideo.addEventListener('error', function(e) { |
| 96 | + console.error('Video loading failed:', e); |
| 97 | + }); |
| 98 | + |
| 99 | + heroVideo.addEventListener('loadeddata', function() { |
| 100 | + heroVideo.play().catch(function(e) { |
| 101 | + console.log('Video playback failed:', e); |
| 102 | + }); |
| 103 | + }); |
| 104 | + } |
| 105 | + }); |
| 106 | + </script> |
76 | 107 | </head> |
77 | | -<body onload="updateComparativeVideos();"> |
| 108 | +<body> |
78 | 109 |
|
79 | 110 |
|
80 | 111 |
|
81 | 112 | <section class="hero is-link is-fullheight video" style="overflow: hidden; position:relative;"> |
82 | 113 | <div class="hero-video" style="height: 100%; width: 177.77777778vh; min-width: 100%;min-height: 56.25vw;"> |
83 | | - <video playsinline autoplay muted loop> |
| 114 | + <video playsinline autoplay muted loop preload="auto" style="width: 100%; height: 100%; object-fit: cover;"> |
84 | 115 | <source src="https://raw.githubusercontent.com/OpenDriveLab/opendrivelab.github.io/master/AMS/teaser.mp4" type="video/mp4"> |
85 | 116 | <!-- <source src="https://assets.kinetixai.cn/AMS/video/teaser.mp4" type="video/mp4"> --> |
86 | 117 | </video> |
|
0 commit comments