perf(docs): stop docs pages auto-downloading 266 MB of video - #586
Open
AlexBodner wants to merge 2 commits into
Open
perf(docs): stop docs pages auto-downloading 266 MB of video#586AlexBodner wants to merge 2 commits into
AlexBodner wants to merge 2 commits into
Conversation
Ten videos across five pages were `autoplay muted loop`, which makes the browser fetch the entire file on page load. Measured against the live sources: evaluations/results.md pulled 147.8 MB per visit, and the docs totalled ~266 MB of automatic downloads. Only one video in the docs had a poster. For all 20 videos: add a poster frame, set preload="none", and pin the element's aspect ratio so it reserves its final height before the poster decodes. Aspect ratios were measured from each source, not assumed: the iou.md comparison renders are 2560x720 (32/9) and the state-estimators video is 1060x2160 portrait (53/108). For the 10 autoplay videos, also drop `autoplay` so the bytes load on click. A poster alone cannot help there: autoplay downloads regardless. This is the one deliberate UX change here and it is called out for review. docs/trackers/bytetrack.md gets preload="none" but no poster: its source returns a hard 404 and there is no frame to extract. Left as-is for a re-upload rather than substituting a different video. No <source> URL was changed. Verified with a local build: 0 errors, all 19 poster paths resolve relative to their built page, 20/20 videos carry preload="none", and in a browser the iou and results pages issue zero mp4 requests until play. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
docs/trackers/bytetrack.md pointed at a GitHub user-attachment that returns a hard 404. It was never an expiry: cross-checking PR #401 (which added all four tracker videos in 351fe5c) shows this UUID never appeared in that PR's body, while a valid video uploaded in the same PR was referenced nowhere. A UUID was transcribed incorrectly, so the page has shown a dead video since 2026-05-08. Point it at the orphaned asset from that PR and add its poster. Confirmed as the correct clip against the original ByteTrack render from the 2026-05-08 thread. The hosted asset is already h264 High, 1280x720, 25fps, 4.9 Mbps, 16.000s, matching its sibling tracker demos, so no re-upload or re-encode is needed. All 20 videos in the docs now have a poster. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
AlexBodner
force-pushed
the
fix/docs-video-loading
branch
from
August 25, 2026 14:20
ad81b23 to
5ef379e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Ten of the twenty
<video>elements in the docs wereautoplay muted loop, which makes browsers fetch the entire file on page load. Measured against the live sources, that is 266 MB downloaded per visit across five pages, withevaluations/results.mdalone pulling 147.8 MB before the reader interacts with anything. Nineteen of the twenty videos also had noposter, so the element stays blank until enough data arrives.Fix
For all 20 videos: add a poster frame, set
preload="none", and pin the element's aspect ratio so it reserves its final height before the poster decodes.For the 10 autoplay videos, also drop
autoplay. A poster does not help there, becauseautoplaydownloads the file regardless. Removing it is the only thing that stops the transfer, so these are nowmuted loopwith click-to-play.That is a real trade: a looping demo shows motion, and a still frame does not. The measured difference on
evaluations/results.md, same machine and network, 12s after load:loadThe usability gain is the argument here, not the SEO one. Core Web Vitals are a ranking signal and four videos saturating the connection delays every other resource, but that effect is indirect and modest, and I could not capture a clean LCP delta to quote.
If we want the motion back later, lazy autoplay via
IntersectionObserverwould start each video when it scrolls into view, keeping the loop without loading all four upfront. That costs JS in the docs and is not part of this PR.Auto-downloaded MB per page load
evaluations/results.mdevaluations/evaluate.mdevaluations/download.mdguides/detection-quality.mdguides/track.mdguides/iou.mdtrackers/sort.mdtrackers/ocsort.mdtrackers/botsort.mdguides/state-estimators.mdThe non-autoplay rows previously fetched a metadata range rather than the whole file, so their "before" is an upper bound.
preload="none"takes them to zero video bytes until click either way.Aspect ratios
Taken from each source rather than assumed, since two are not 16/9:
guides/iou.mdcomparison renders are 2560x720, soaspect-ratio: 32/9guides/state-estimators.mdis 1060x2160 portrait, soaspect-ratio: 53/108, kept alongside its existingwidth: 50%; height: autoThe rest are 1280x720 or 1920x1080.
Also: the ByteTrack demo video was dead
docs/trackers/bytetrack.mdpointed at a GitHub user-attachment returning a hard 404, so that page has shown a dead video since 2026-05-08.It was not an expiry. All four tracker videos were added in one commit, 351fe5c (#401). Cross-checking that PR's body against what landed in the docs:
98c73178...9ccae3a0...7dfa0326...9c9736c9...The UUID in
bytetrack.mdwas never uploaded to that PR, while a valid video uploaded in the same PR was referenced nowhere. A UUID was transcribed incorrectly.I checked the orphaned asset against the original ByteTrack render from our 2026-05-08 thread: it is the same clip. It is already
h264 High, 1280x720, 25fps, 4.9 Mbps, 16.000s, matching its sibling tracker demos, so no re-upload or re-encode is needed. All 20 videos now have a poster.Validation
mkdocs buildruns clean. The one INFO line is a pre-existing dead anchor (trackers/cbiou.md#buffer-ordering), unrelated to this change.poster=paths resolve relative to their built page, and all 20 videos carrypreload="none"in the built site./guides/iou/and/evaluations/results/reportreadyState: 0andnetworkState: 1on every video, with zero mp4 requests until play. Playback and the captions track onindex.mdstill work.<source>URL changed except the ByteTrack fix above. The diff touches<video>tags only, no prose.🤖 Generated with Claude Code