Armstrong Websites

Articles · Website basics

How to add a video to your website without slowing it down

By Armstrong Websites. Published . Updated .

The best way to add a video to a small business website is to upload it to YouTube or Vimeo and embed it on your page. You paste a short block of code, and the video plays on your page while the video service handles the heavy file.

Do not upload a large video file straight to your web host unless you have a reason. Video files are big. A few visitors playing one at the same time can slow your whole site.

This guide covers both methods, plus the small settings that keep the page fast and usable.

Pick the right method

Embed from YouTube or Vimeo. Use this for almost every business video. The video lives on their servers. Your page only loads a small player. It plays well on phones and adjusts to the visitor’s connection.

Upload the file to your own site. Use this for a short, silent clip, such as a looping background in a page header. Keep the file small. Most website builders let you add a video file in the media library or in a video block.

Link out instead. If the video is long or your platform does not allow embeds, link to the video with a clear button. Visitors leave your page, but your page stays fast.

Embed a YouTube video

First, upload your video to YouTube. Choose a clear title and write a short description.

Next, set the visibility. “Public” lets anyone find it on YouTube. “Unlisted” hides it from YouTube search, but anyone with the link or your page can watch. Pick the one that fits how you want the video shared.

Then open the video, select Share, and select Embed. YouTube shows a block of code that starts with <iframe. Copy it.

Paste it into an “HTML” or “custom code” block on your page. Many builders also have a plain “video” block where you paste only the video’s web address. That works too, and it is easier.

Make three changes to the embed code

The code YouTube gives you works as is. Three small edits make it better.

Add a title. Screen readers announce the title of an embedded video. Add a short, plain description inside the code, for example title="Our crew pressure washing a deck". YouTube usually includes a title already. Check that it says something useful. What is website accessibility and how to start covers more of these basics.

Add lazy loading. Add loading="lazy" to the iframe. The browser then waits to load the video until the visitor scrolls near it. A page with a video lower down opens faster.

Use the privacy-enhanced address. Change youtube.com in the code to youtube-nocookie.com. YouTube offers this as its privacy-enhanced mode. It limits tracking until the visitor plays the video. A standard embed can set cookies as soon as the page loads. If you run a cookie banner or plan to, read does your website need a cookie banner in Canada.

A finished embed looks like this:

<iframe src="https://www.youtube-nocookie.com/embed/VIDEO_ID" title="Our crew pressure washing a deck" loading="lazy" allowfullscreen></iframe>

Replace VIDEO_ID with the ID from your own video. Keep any other settings YouTube gave you in the original code.

Vimeo works the same way

Upload the video to Vimeo, open the share options, and copy the embed code. Add a title and loading="lazy" in the same way. Vimeo has fewer ads and a cleaner player, but free accounts have limits on storage and features. Check their current plans before you choose.

Make the video fit on a phone

Most visitors to a local business site are on a phone. A video with a fixed width can spill off the edge of the screen. Check how the video looks before you publish.

Most builders resize embeds for you. If yours does not, add this CSS to the video: width: 100%; aspect-ratio: 16 / 9; border: 0;. The video then fills the width of its column and keeps the right shape. How to test your website on a phone lists what to check.

If you upload the file yourself

Use the MP4 format. Nearly every browser plays it. Compress the file before you upload it. Free tools can shrink a video a lot with little change you can see. Aim for a clip of a few seconds to a minute, not a full-length video.

Add these settings to the video code:

poster sets a still image that shows before the video loads. Use a compressed photo. How to resize photos so your website loads fast explains how.

preload=“metadata” tells the browser to load only basic details until the visitor presses play. This saves data.

playsinline keeps the video on the page on iPhones instead of forcing full screen. This matters for muted looping clips.

controls shows the play button and volume. Leave it on for any video with sound.

Skip autoplay with sound

Browsers block autoplay when a video has sound. Visitors also dislike surprise noise. Let people press play.

Muted autoplay is allowed in most browsers. Use it only for short decorative loops. Add muted, loop, and playsinline to the code. Never put key information in a muted loop that has no text.

Add captions and text

Many people watch with the sound off. Others are deaf or hard of hearing. Add captions.

YouTube creates automatic captions for many videos. They contain mistakes, especially with trade terms and local place names. Open the captions in YouTube Studio and fix them.

Also write the main points in text on the page, near the video. Search engines read your text, not your video. Text also helps visitors who skip the video.

Place it where it helps

Put the video near the top of the page it supports. A short intro on the About page, a how-it-works clip on a service page, or a tour of your shop on the home page all work. Add a line of text before it that says what the video shows and how long it runs.

Do not stack three videos on one page. Each one adds weight. Use one video per page, and place a clear next step below it. What is a call to action and how to write one shows how to word that step.

Check the speed after you add it

Open the page on your phone on mobile data, not Wi-Fi. Watch how long the text and images take to appear. If the page feels slower after you added the video, remove the autoplay, add lazy loading, or replace the video with a still image that links to it. Why is my website slow and how to fix it lists other causes to check.

If your platform will not accept embed code, or the video leaves a gap on your page, send a note through the contact page. A short message with the page link is enough to start.

Ready when you are

Book a coffee