---
title: "Tech Tip #52: Load video only when someone presses play"
description: "Autoloaded video can outweigh the rest of the page."
url: https://greencode.ai/tech-tips/52-load-video-on-play/
---

# Tech Tip #52: Load video only when someone presses play

**Autoloaded video can outweigh the rest of the page.**

[Watch the video](https://media.greencode.ai/shorts/load-video-on-play-1c88481e1c10.mp4)

Video created by [explainapaper.com](https://explainapaper.com/?utm_source=greencode.ai&utm_medium=film&utm_campaign=made-by)

### The problem

Pages embed video players that fetch the video, or a heavy player script, as soon as the page opens, whether anyone watches or not.

### The fix you can use today

- Show a poster image and fetch the video only on click.
- Use preload="none" on video elements.
- Swap a lightweight placeholder for third-party players until they are used.

GreenCode's own website loads its films only when someone presses play.

### Tools that help

- [Lighthouse](https://developer.chrome.com/docs/lighthouse/overview?utm_source=greencode.ai&utm_medium=referral&utm_campaign=greencode): audits a page for total byte weight, unused JavaScript and CSS, image formats and offscreen images
- [WebPageTest](https://www.webpagetest.org/?utm_source=greencode.ai&utm_medium=referral&utm_campaign=greencode): loads a real page and shows every request, its size and when it loaded

### How GreenCode helps

GreenCode helps tackle this by practising it on greencode.ai: films load only when someone presses play, and static pages, WebP images and scripts only where they are used cut the home page's first view from 6,766 KB to 1,719 KB. [More on this](https://greencode.ai/green-hosting/).

### Tags

#video#web-performance#frontend

### Sources

- [Green hosting: films delivered only when wanted](https://greencode.ai/green-hosting/)
- [HTTP Archive, Web Almanac 2024, Sustainability: video preload and autoplay](https://almanac.httparchive.org/en/2024/sustainability?utm_source=greencode.ai&utm_medium=referral&utm_campaign=greencode)
- [W3C, Web Sustainability Guidelines: disable autoplay, use facades for heavy media](https://www.w3.org/TR/web-sustainability-guidelines/#user-controlled-media)

[All GreenCode Tech Tips](https://greencode.ai/tech-tips/)

#### Key Facts

- Tip **#52**
- For **Developers**
- Category **Web and front-end**
- Format **short video**
![GreenCode](https://greencode.ai/wp-content/uploads/2024/12/greencode-logo-website-small-colours-2.webp)

Want this checked on your own system? Talk to the GreenCode team.

[Get in touch](https://greencode.ai/contact/)
