From 71b06bc64ab9b259157557c3625f87d468bda37e Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Wed, 15 Jul 2026 15:40:25 +0200 Subject: [PATCH] f --- public/s/js/f0ckm.js | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/public/s/js/f0ckm.js b/public/s/js/f0ckm.js index 9399eb8..eee6da0 100644 --- a/public/s/js/f0ckm.js +++ b/public/s/js/f0ckm.js @@ -3486,23 +3486,10 @@ window.cancelAnimFrame = (function () { } else { container.insertAdjacentHTML('beforeend', html); - // ── Prefetch video src immediately after DOM injection ────────────── - // tells the browser to start downloading the - // video file now, racing against v0ck init so play() has data waiting. - const _vidEl = container.querySelector('#my-video[src]'); - if (_vidEl && _vidEl.tagName === 'VIDEO') { - const _vidSrc = _vidEl.getAttribute('src'); - if (_vidSrc) { - document.head.querySelector('link[data-v0ck-prefetch]')?.remove(); - const _pLink = document.createElement('link'); - _pLink.rel = 'prefetch'; - _pLink.as = 'video'; - _pLink.href = _vidSrc; - _pLink.setAttribute('data-v0ck-prefetch', '1'); - document.head.appendChild(_pLink); - window.f0ckDebug('[v0ck] Prefetch link injected for', _vidSrc); - } - } + // Note: Prefetching video src immediately after DOM injection has been removed + // because concurrent media requests to the same URL in Chromium-based browsers + // trigger the single-writer HTTP cache lock, causing playback to stall. + } @@ -8485,20 +8472,8 @@ document.addEventListener('DOMContentLoaded', () => { thumb.appendChild(video); activeVideo = video; - // ── Prefetch first 512 KB to prime browser cache before click ── - // Low-priority range request fires while user is still hovering. - // On click, the item page video element hits cache instead of network. - if (!window._prefetchedVideos) window._prefetchedVideos = new Set(); - const _pUrl = `/b/${file}`; - if (!window._prefetchedVideos.has(_pUrl)) { - window._prefetchedVideos.add(_pUrl); - fetch(_pUrl, { - method: 'GET', - headers: { 'Range': 'bytes=0-524287' }, - credentials: 'include', - priority: 'low', - }).catch(() => { window._prefetchedVideos.delete(_pUrl); }); - } + // Note: Hover prefetching of the first 512 KB has been removed to prevent + // Chromium cache locks and validation loop stalls on subsequent playback. }; if (delay === 0) {