The short answer
To add video on a website without slowing it, either embed from a video platform or self-host a compressed file, and load the player late. Use a still image with a play button that loads the real player on click, reserve space with width and height, avoid autoplay with sound, and test the page on a phone before and after.
Video on website pages: four ways to add it
Video on website pages usually arrives in one of four ways, and each has a different cost to speed. Choose by what the video is for, not by what is quickest to paste in.
| Method | How it works | Speed cost | Control |
|---|---|---|---|
| Embed from a video platform | An iframe loads a player from a service such as YouTube or Vimeo | Extra scripts and files from another company, which can keep the page busy | Limited. The platform decides the player look and many behaviours |
| Click-to-load embed | A still image and play button stand in until the visitor clicks, then the real player loads | Small until someone presses play | Same as an embed, with a short wait on first play |
| Self-hosted file | A video element plays a file stored with your website | The size of the file and the load on your hosting | High. You choose format, controls, captions and design |
| Background loop | A short silent clip plays behind a heading | Often the worst, because autoplay begins downloading at once | Full, but purely decorative |
A single page can mix methods. A tutorial page might use a click-to-load embed, while a home page might use a very short background loop or none at all.
Does video slow a page down?
It can, in three separate ways. Large files take time to download, and a video that starts on its own begins downloading at once, even if it sits far below the first screen. Embeds from video platforms bring their own code, and Google's web performance guidance warns that third-party embeds can include a lot of script and keep the browser busy, which can make the page slow to respond to taps. Finally, a video or player with no stated size can push the content around as it loads.
Those effects land on the three measures Google calls Core Web Vitals: how quickly the main content appears, how fast the page responds to input and how stable the layout stays. The guide to Core Web Vitals explains each measure and how to check them.
Video is not the enemy of a fast page. An uncompressed file dropped in without thought is. Plan the video the way you plan any large image: how big it needs to be, when it needs to load, and what shows while it waits.
Embedding or hosting yourself: which to choose
Embedding from a platform means the service stores the file, converts it for different devices and streams it to the visitor. You avoid running video infrastructure yourself, and you may gain an audience on the platform. The costs are third-party scripts on your page, less control over the look and recommended-video behaviour depending on the platform's settings, and a dependency on a service that can change its player.
Hosting the file yourself gives control and keeps the page free of outside code. It also puts the load on your own hosting. A short clip for a few thousand visits is a different job from a long film watched by many people at once, and ordinary website hosting is not designed for heavy streaming. Ask your host about limits before you plan around it.
A practical rule: short, decorative or product clips of a few seconds can be self-hosted. Longer videos that people watch from start to finish are usually better placed with a platform that handles the delivery. Whichever you choose, keep the original file safe, and keep the page's written content complete so the page still makes sense without playing the clip.
How to embed a video without a heavy page
Three changes make most of the difference.
- Add the loading attribute set to lazy on the iframe, so the browser defers the player until the visitor scrolls near it. Browser-level lazy loading for iframes is widely supported. Embeds below the first screen should always use it.
- Give the iframe a width and height, or set an aspect ratio in the style, so the space is reserved before the player arrives and nothing jumps.
- Use a click-to-load placeholder, often called a facade: a lightweight image and play button that load the real player only when clicked. Lighthouse and the web.dev guidance both recommend this approach for heavy embeds, and ready-made facade components exist for some platforms. The trade-off is that autoplay may not work consistently when a video loads lazily.
Keep the number of embeds per page low. Five players on one page is five sets of scripts. If a page needs several videos, a list of thumbnails that opens one player on click is lighter than loading each. And if an embed still performs badly, a plain link to the video is better than a slow page.
Check the platform's embed options and privacy settings too. Embedded players may set cookies, and the rules on cookies and consent differ by country, so ask a lawyer or read your regulator's guidance if you serve visitors in several regions.
How to host a video file yourself
Self-hosting uses the HTML video element. The settings that matter most are these.
- Encode the file before you upload it. Export at the display size you need, not at the size of the camera original, and offer both MP4 and WebM sources if you want broad coverage; the browser picks the first it can play.
- Set the preload attribute to none for a video that sits lower on the page, which gives the best chance of avoiding a download until someone plays it. Browsers treat preload as a hint, and most default to loading the metadata only.
- Add a poster image, which shows before play. Compress it like any other image, and check that its size matches the player.
- Set width and height so the layout does not shift.
- Provide captions with a caption track, for visitors who cannot hear the sound or are watching in a quiet place.
Keep the clip as short as it can be while still doing its job. A product demo that gets to the point in the first few seconds is both lighter and more watchable.
Background video and autoplay
A looping video behind a heading looks lively and is the riskiest option for speed. A video set to autoplay starts downloading immediately, whatever its position. If you use one, make it as short and small as possible, with no audio track, muted, looped and marked to play inline so phones do not open it full screen. Those settings are also what browsers generally require for autoplay to be allowed. Use a poster image as the fallback while it loads.
If the poster or the video is the main content in view when the page opens, it may be the element Google's LCP measure picks up. In that case web.dev advises preloading the poster with high fetch priority. Consider not playing the video at all on small screens, where it matters least and costs most.
Motion and accessibility need thought as well. Accessibility guidance asks for a way to pause or stop content that moves on its own, and some visitors set their device to reduce motion, so give a clear pause control and respect that setting. Check the current WCAG documentation for the exact requirement. Make sure text laid over moving footage keeps enough contrast at every moment.
Where video belongs on the page
Put the answer in words first, then the video as support. A service page that opens with a play button and no text gives search engines and impatient visitors little to go on. For product pages, a short demonstration below the key details is usually stronger than one above them.
Be careful on pages whose main job is something else. On a contact page the visitor wants to write to you or find you quickly, so a video should not push the form down the screen. The guide to what a contact page should include lists the elements that come first.
Decide early whether each video lives inline on a page or has a page of its own. Google's video guidance suggests a dedicated page for each video where that suits the business, and says the video must be embedded on an indexed page for it to be found, without relying on a click or swipe to load it. For more on how pages fit together, see how to plan website structure and page hierarchy. If you want the video to appear in search features, Google asks for details such as a title, a thumbnail and an upload date in structured data; check Google's current video documentation for the full list.
Testing and looking after video
Test the page before and after you add video, using PageSpeed Insights or a similar tool, and test on a real phone, ideally on a slower connection. Work through this order.
- Load the page with the video in place and note how long the main content takes to appear.
- Scroll slowly and watch for jumps in the layout.
- Press play on a phone and a desktop browser, and check captions and the pause control.
- Operate the controls with the keyboard alone.
- Repeat the test after any change to the player, the platform's embed code or your hosting.
A video that stops playing is not always noticed by a basic monitor that only checks whether the page loads, so check it by eye as well. Website uptime monitoring explained covers what monitors do and do not see.
If budget is tight, free tools exist for recording, editing and hosting video, and the roundup of free resources for boosting your startup growth is a general starting point; check each tool's terms and limits first. For help adding video to a new or existing site in a way that keeps pages fast, Liftup Technologies' website development service is one place to start.
