From d7e7d248cbe41cd7a9ef9c2fb022b6c4831f99a3 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 31 May 2026 15:22:56 +0000
Subject: [PATCH] =jakevan complete
---
build/video/view.js | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 48 insertions(+), 1 deletions(-)
diff --git a/build/video/view.js b/build/video/view.js
index 2e03534..76c32ab 100644
--- a/build/video/view.js
+++ b/build/video/view.js
@@ -1 +1,48 @@
-document.addEventListener("DOMContentLoaded",(function(){const e=[].slice.call(document.querySelectorAll(".video-container video"));function r(e){e.querySelectorAll("source[data-src]").forEach((e=>{e.src=e.dataset.src})),e.load()}if("IntersectionObserver"in window){const t=new IntersectionObserver((function(e,t){e.forEach((e=>{e.isIntersecting&&(r(e.target),t.unobserve(e.target))}))}),{rootMargin:"200px 0px",threshold:.1});e.forEach((e=>t.observe(e)))}else"requestIdleCallback"in window?requestIdleCallback((()=>{e.forEach((e=>r(e)))})):e.forEach((e=>r(e)))}));
\ No newline at end of file
+/******/ (() => { // webpackBootstrap
+/*!***************************!*\
+ !*** ./src/video/view.js ***!
+ \***************************/
+/** view.js **/
+document.addEventListener("DOMContentLoaded", function () {
+ const lazyVideos = [].slice.call(document.querySelectorAll(".video-container video"));
+
+ // Build a helper to actually set sources + load
+ function loadVideo(video) {
+ const sources = video.querySelectorAll("source[data-src]");
+ sources.forEach(source => {
+ source.src = source.dataset.src;
+ });
+ video.load();
+ }
+
+ // --- 1. IntersectionObserver (best case) ---
+ if ("IntersectionObserver" in window) {
+ const lazyVideoObserver = new IntersectionObserver(function (entries, observer) {
+ entries.forEach(entry => {
+ if (entry.isIntersecting) {
+ loadVideo(entry.target);
+ observer.unobserve(entry.target);
+ }
+ });
+ }, {
+ rootMargin: "200px 0px",
+ threshold: 0.1
+ });
+ lazyVideos.forEach(video => lazyVideoObserver.observe(video));
+ return;
+ }
+
+ // --- 2. Fallback: requestIdleCallback ---
+ if ("requestIdleCallback" in window) {
+ requestIdleCallback(() => {
+ lazyVideos.forEach(video => loadVideo(video));
+ });
+ return;
+ }
+
+ // --- 3. Final fallback: load immediately ---
+ lazyVideos.forEach(video => loadVideo(video));
+});
+/******/ })()
+;
+//# sourceMappingURL=view.js.map
\ No newline at end of file
--
Gitblit v1.10.0