skip to content

A marketing team wants an autoplaying full-bleed background video as the hero on the site's highest-traffic landing page. What would you require before shipping it, framed in terms of Largest Contentful Paint and Cumulative Layout Shift?

level: principalimportance: should knowfreq 30%

answer

  1. price the feature, do not veto it
  2. the poster is the real hero
  3. reserve the box, CLS goes to zero
  4. video bytes are subordinate
  5. agree the rollback threshold first

basics

~20 s

Treat the poster image as the real hero: it is the LCP candidate and gets full image discipline. Reserve the video box with a fixed aspect ratio so nothing shifts, defer the video bytes until after the poster paints, and agree a field-data kill criterion up front.

solid answer

~50 s

I would not refuse it, I would price it. Three requirements. First, **the poster image is the hero** — in current Chrome a `<video>` element's poster is an LCP candidate, so it gets the same discipline as any hero image: discoverable in markup, sized to the viewport, prioritised. The video itself will not paint fast enough to be your LCP story. Second, **the box is reserved** with an explicit aspect ratio so the video's arrival cannot move anything below it; that takes the CLS risk to zero by construction. Third, **the video bytes are subordinate** — they load after the poster has painted and after the critical path is clear, and there is a byte budget for them. Then I would attach a field-data condition: if the page's 75th-percentile LCP on mobile regresses past the agreed line after rollout, the video comes out. That last part is what makes it a decision rather than an opinion.

code

css · 10 lines
css
.hero {
  aspect-ratio: 16 / 9;
  width: 100%;
}

.hero video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

go deeper

for a junior

Know that a large autoplaying video is expensive and that the still poster image is what users see first. Be able to say that the hero area needs a reserved size so nothing jumps when the video loads.

for a middle

Explain which vital each part touches: the poster drives LCP because it is the candidate that paints, and an unreserved video box drives CLS until its dimensions are known. Name the aspect-ratio reservation as the concrete fix.

for a senior

Show that you would keep the video bytes off the critical path, treat the poster with full hero-image discipline, and verify in field data at the 75th percentile on mobile rather than in a lab run on good hardware.

for a principal

Own the decision framing: a named budget, an accessibility carve-out, a cheaper alternative offered alongside, and an explicit rollback threshold with an owner — so the argument is settled by measurement once rather than re-fought every quarter.

## Reframe the question before answering it The weak answer is a verdict — "background video is bad for performance". The strong answer treats it as a purchase: this feature has a price in the two loading vitals, here is how the price is capped, here is who agreed to pay it, and here is the condition under which we stop paying. Interviewers ask this to see whether you can hold a business goal and a performance budget in the same hand. ## What actually gets measured **LCP.** A video element does not paint content the instant it is requested; there is a fetch, container parsing, and enough buffering to render a frame. What paints early is the **poster image**, and Chrome treats a video's poster image as an LCP candidate — in recent versions the first painted video frame can be a candidate too. The practical consequence is that your hero's LCP is a *poster image problem wearing a video costume*. So all the image discipline applies to the poster: it must be discoverable in the initial markup rather than injected later, it must be sized for the viewport rather than shipped at desktop dimensions to phones, and it deserves priority over less important resources. The failure mode to name explicitly is a hero video with **no poster at all**. Then the hero region paints nothing for a while, the LCP element becomes some smaller piece of content elsewhere, and when the video finally paints you can get a much later LCP entry. The team ships what feels like a premium experience and the field data shows a cliff. **CLS.** This half is genuinely easy to make zero. The shift risk comes from the video element having no reserved height until its metadata is known, so the content below jumps when the intrinsic dimensions arrive. Pinning the container's aspect ratio removes the possibility entirely — the box occupies its final size from first layout, and the video simply fills it. ```css .hero { aspect-ratio: 16 / 9; width: 100%; } .hero video { width: 100%; height: 100%; object-fit: cover; } ``` This is worth stating as a principle: of the two vitals, CLS from media is a *design decision* you can eliminate by construction, while LCP is a *budget* you have to manage continuously. Do not spend negotiating capital on the one you can simply engineer away. ## The requirements I would actually write down 1. **A poster exists, and it is treated as the page's hero image.** Real markup, right dimensions for the viewport, prioritised ahead of the video bytes. 2. **The hero box is reserved by aspect ratio**, so CLS attributable to the hero is zero and stays zero. 3. **The video is subordinate to the critical path.** Its bytes must not compete with the poster, the critical CSS, or the primary content. A byte budget is agreed in advance, and it is smaller than people expect for something that is decorative by definition. 4. **Not everyone gets it.** Reduced-motion users should get the still poster instead of the loop; that is an accessibility requirement, and it conveniently also spares the cheapest devices. 5. **A rollback condition in field data.** A named threshold on 75th-percentile mobile LCP for that page, checked after rollout, with an agreed owner and an agreed action. ## Why the rollback condition is the important one Everything above item five is engineering that a competent team does anyway. Item five is what makes this a principal-level answer: it converts a permanent argument into a measured experiment. Marketing gets to try the thing they believe converts; performance gets a defined exit rather than a veto it must defend at every planning meeting. If the conversion lift is real and the LCP cost is small, the data says keep it; if the LCP regression is severe and the lift is noise, the same data removes it without anyone re-litigating taste. The measurement has to be **field data on the target page**, not a lab run. A lab test on a fast connection shows a video that buffers instantly and a poster that is already cached. The population that determines the score is on mid-tier phones and variable networks, and it is the only population whose experience actually changed. ## The honest tradeoff to state out loud Background video is one of the few features where the performance cost is close to pure — the user is not waiting for it in order to do anything, so every byte is spent on atmosphere. That does not make it illegitimate; brand pages exist to create an impression. It does mean the burden of proof sits with the feature, and that a cheaper substitute — a high-quality still, or a very short loop that starts only after the page is interactive — usually captures most of the intended effect for a small fraction of the cost. Offering that alternative, rather than a flat refusal, is what gets you a yes on the requirements.

  • Marketing insists there is no good still frame for a poster. What do you do?
    Push back, because shipping without one means the hero paints nothing early and LCP lands on something unintended or much later. Extract a representative frame and treat it as a design asset with the same care as the video's first seconds. If the loop genuinely has no coherent still, that is evidence the loop is the wrong hero, not evidence the poster is optional.
  • Why insist on field data rather than a Lighthouse run before and after?
    A lab run uses one device profile and one network, usually far better than the real audience's, and it typically has the assets warm. The video's cost is concentrated in slow connections and mid-tier hardware, which is exactly what a 75th-percentile field measurement captures and a single lab run averages away.
  • How would you reduce the cost without dropping the feature entirely?
    Keep the poster as the only thing on the critical path, start the video only once the page is interactive, cap its duration and dimensions hard since it is decorative, and skip it altogether for users who prefer reduced motion or are on constrained connections. Most of the intended impression survives; most of the cost does not.

saying these in an interview costs you the question

  • Answers with a flat veto instead of a priced tradeoff
  • Forgets the poster image and thinks the video itself is the LCP paint
  • Assumes video-caused layout shift is unavoidable
  • Validates the change with one lab run on a laptop
  • Ships with no agreed threshold for removing it

context