Skip to content

perf(thumbnails): load the thumbnail images on demand - #388

Merged
antobinary merged 1 commit into
bigbluebutton:developfrom
germanocaumo:perf-thumbnails-lazy
Nov 18, 2026
Merged

antobinary merged 1 commit into
bigbluebutton:developfrom
germanocaumo:perf-thumbnails-lazy

Conversation

@germanocaumo

@germanocaumo germanocaumo commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Loads the thumbnail strip's slide images on demand instead of all of them while the player loads.

Each thumbnail is the slide image itself (an SVG of up to several hundred KB in tldraw recordings), and every one was fetched on load although the strip only shows a few at a time. The images are now loading="lazy".

That alone defers almost nothing (37 of 45 requests still go out): the CSS sets the images' height and leaves the width auto, so an image not loaded yet is 0 px wide and the whole strip fits in the lazy-loading margin. The images now also get the slide's width and height from shapes.svg (passed through buildThumbnails and the thumbnail components), which the browser turns into a placeholder aspect ratio until the image loads. Images without valid dimensions are left as before.

A CSS-only placeholder (aspect-ratio: auto 16 / 9 on the images) defers the same requests without the plumbing, but slides of another shape then resize as they load, and in Firefox the auto-scroll to the current thumbnail lands off-centre (see the table). Exact sizes keep it centred in every browser.

The ≤2.5 PNG slide renderer shows the slide's thumbnail as a placeholder while the full slide loads; after a far seek that thumbnail is now fetched with the slide instead of being already cached.

Also part of #376, which bundles it with a redesign.

How to test

A tldraw recording with 103 thumbnails (45 distinct 4:3 slides), desktop width:

develop this PR CSS-only placeholder
Slide image requests on load (Chrome / WebKit / Firefox) 45 / 45 / 45 20 / 25 / 12 20 / 25 / 12
Slide image data on load (decoded, Chrome) 15.4 MiB 7.5 MiB 7.5 MiB
Thumbnails loaded after scrolling the strip to the end (Chrome, Firefox) 103 / 103 103 / 103 103 / 103
Active thumbnail after seeking to 50% / 85% / 95%, Chrome and WebKit centred (444 / 528 / 672 px) same same
Same, Firefox (two runs) centred same, never moves 327 px in one run at 50%; jumps 400 → 528 px at 85%

Also compared with develop on recordings from 3.0.27+, 3.0.2–3.0.26, 2.6 (tldraw), ≤2.5 (PNG slides), audio-only and layout.single, at desktop and phone widths: same thumbnails and thumbnail widths as develop in every case; only fewer images loaded up front on narrow screens.

Changelog

  • Technical: thumbnail images are lazy loaded and sized from the slide dimensions
  • User-facing: recordings with many slides load less data up front

Every slide image in the thumbnail strip was fetched while the player
loaded, although only a few are visible. Lazy load them, and give each
image the slide's dimensions so the images not loaded yet keep their
width: with none, they are 0 wide and the whole strip counts as visible.
@antobinary
antobinary merged commit d52a938 into bigbluebutton:develop Nov 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants