Skip to content

Commit 23f545f

Browse files
committed
goal reaching
1 parent 74a67e6 commit 23f545f

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

index.html

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2610,6 +2610,22 @@
26102610
waitForHeroVideo(() => {
26112611
console.log('🎬 Hero video loaded! Starting to load other videos...');
26122612

2613+
// Restore frameVideo immediately when hero video is loaded (it's in viewport)
2614+
const frameVideo = document.getElementById('frameVideo');
2615+
if (frameVideo) {
2616+
if (frameVideo.hasAttribute('data-temp-src') && !frameVideo.src) {
2617+
frameVideo.src = frameVideo.getAttribute('data-temp-src');
2618+
frameVideo.removeAttribute('data-temp-src');
2619+
frameVideo.load();
2620+
}
2621+
const frameSource = frameVideo.querySelector('source');
2622+
if (frameSource && frameSource.hasAttribute('data-temp-src') && !frameSource.src) {
2623+
frameSource.src = frameSource.getAttribute('data-temp-src');
2624+
frameSource.removeAttribute('data-temp-src');
2625+
frameVideo.load();
2626+
}
2627+
}
2628+
26132629
// Set up smart Intersection Observer for optimized loading
26142630
const videoObserver = new IntersectionObserver((entries) => {
26152631
entries.forEach(entry => {
@@ -2631,11 +2647,13 @@
26312647
if (video.hasAttribute('data-temp-src') && !video.src) {
26322648
video.src = video.getAttribute('data-temp-src');
26332649
video.removeAttribute('data-temp-src');
2650+
video.load();
26342651
}
26352652
const source = video.querySelector('source');
26362653
if (source && source.hasAttribute('data-temp-src') && !source.src) {
26372654
source.src = source.getAttribute('data-temp-src');
26382655
source.removeAttribute('data-temp-src');
2656+
video.load();
26392657
}
26402658

26412659
// Change preload from "none" to appropriate value
@@ -2689,10 +2707,27 @@
26892707
});
26902708

26912709
// Observe all videos except hero videos (after delay)
2710+
// Also ensure frameVideo is observed and loaded immediately since it's critical
26922711
document.querySelectorAll('video').forEach(video => {
26932712
// Skip hero videos - they're already loading with high priority
26942713
if (video.id !== 'hero-video-main' && video.id !== 'hero-video-mobile') {
26952714
videoObserver.observe(video);
2715+
2716+
// If it's frameVideo, ensure it's loaded immediately (it's in viewport)
2717+
if (video.id === 'frameVideo') {
2718+
// Restore src if it was blocked
2719+
if (video.hasAttribute('data-temp-src') && !video.src) {
2720+
video.src = video.getAttribute('data-temp-src');
2721+
video.removeAttribute('data-temp-src');
2722+
video.load();
2723+
}
2724+
const source = video.querySelector('source');
2725+
if (source && source.hasAttribute('data-temp-src') && !source.src) {
2726+
source.src = source.getAttribute('data-temp-src');
2727+
source.removeAttribute('data-temp-src');
2728+
video.load();
2729+
}
2730+
}
26962731
}
26972732
});
26982733

0 commit comments

Comments
 (0)