How to add a video background to a hero section in Framer
Updated
In Framer, insert a Video layer (Insert → Media → Video), stretch it to fill your hero, send it behind the text, and set it to autoplay, loop and mute. Keep looping videos under about 5 MB and always give them a poster image.
A seamless 3D hero loop: the kind of video this guide is about
Option 1: a Video layer
- 1Select your hero frame and choose Insert → Media → Video.
- 2Upload your file or paste a hosted MP4 URL.
- 3Set the video to fill the frame (pin all sides, cover), and move it below your text layers.
- 4In the video settings, turn on Autoplay, Loop and Muted, set Controls to Hide, and add a Poster image.
- 5Preview, then publish and check it on a phone.
Limits to know
- Framer recommends keeping looping videos under 5 MB, because browsers only cache about 5 to 8 MB.
- Framer doesn't compress, resize or transcode uploads, so the file you upload is the file visitors download.
- Lazy loading depends on the poster, so set one on every video.
- A video set to Muted, Loop, Playing and Controls: Hide pauses automatically when it's off screen.
- AV1 isn't supported on some older iOS and Mac versions, so keep an MP4 (H.264) version.
- The Free plan limits uploads to 5 MB.
Option 2: an Embed with custom HTML
For a transparent video or your own player, use Framer's Embed component, which accepts HTML including a <script>. Framer's help docs don't say which plans include custom code, so check your plan before relying on it.
- 1Choose Insert → Embed and switch it to HTML.
- 2Paste the snippet below with your own file URLs, and size the Embed to fill the hero frame.
- 3For a script every page needs, use Project Settings → Custom Code → Add Script, where you pick placement and pages.
<section class="hero">
<video class="hero__video" autoplay muted loop playsinline
preload="metadata" poster="/hero-poster.webp" aria-hidden="true">
<source src="/hero-loop.av1.webm" type='video/webm; codecs="av01.0.08M.10"'>
<source src="/hero-loop.mp4" type="video/mp4">
</video>
<div class="hero__content">
<h1>Your headline</h1>
</div>
</section>
<style>
.hero { position: relative; isolation: isolate; min-height: 90vh; overflow: hidden; }
.hero__video { position: absolute; inset: 0; z-index: -1;
width: 100%; height: 100%; object-fit: cover; }
@media (prefers-reduced-motion: reduce) {
.hero__video { display: none; }
.hero { background: url(/hero-poster.webp) center / cover; }
}
</style>Things that trip people up
- Uploading a big master file is the most common mistake; export a web version first.
- Text over video needs contrast. Add a subtle gradient layer between the video and your heading.
The one-line version
Edgeloop loops ship with a small player that does all of the above for you: the right format per browser, a poster while it loads, pausing off-screen, reduced-motion support and a transparent version for your own background.
<script src="https://edgeloop.studio/hero-loop.js" defer></script>
<hero-loop src="/loops/your-loop/" focus="right center"></hero-loop>Collection 01 opens soon. Join the waitlist for 3 free loops.
Questions
How big should a Framer background video be?
Under about 5 MB for a looping video. Framer doesn't compress uploads, so size it before you upload.
Does Framer pause background videos off screen?
Yes, when the video is Muted, Loop, Playing and Controls: Hide.
Do I need a poster image in Framer?
Yes. Framer's lazy loading relies on it, and it's what visitors see while the video loads.