Built-in element or Code Embed?
- Background Video
- The simplest choice when one short clip works on every screen. It comes with its own play and pause button. See Webflow’s Background Video guidance.
- Code Embed
- The choice when phones need a different edit, or when the desktop file is too heavy to send to a phone.
Add a phone cut with a Code Embed
- Get a public MP4 link and an opening still for each cut. With Speedy Clip, you can skip this step and the next: paste its embed into the Code Embed, as it already lists every cut.
- Add a Code Embed inside the hero section and paste the example below. Publish once with the sample video to check it plays, then swap in your own files and stills.
- Publish to your staging domain. Open it on a phone and on a desktop and play it on both, so you can see each cut.
<div class="responsive-clip">
<picture>
<source srcset="https://speedyclip.com/media/home/doorway-wide.webp" media="(min-width: 768px)">
<img src="https://speedyclip.com/media/home/doorway-tall.webp" alt="">
</picture>
<video controls muted playsinline preload="none" tabindex="0"
poster="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" aria-label="Bronze doors opening onto the sea">
<source src="https://speedyclip.com/media/home/doorway-wide.mp4" type="video/mp4" media="(min-width: 768px)">
<source src="https://speedyclip.com/media/home/doorway-tall.mp4" type="video/mp4">
</video>
<button type="button" hidden>Play video</button>
</div>
<style>
.responsive-clip { position: relative; aspect-ratio: 674 / 1280; }
.responsive-clip :is(picture, img, video) {
position: absolute; inset: 0;
width: 100%; height: 100%; object-fit: cover;
}
.responsive-clip.is-ready video { visibility: hidden; }
.responsive-clip button { position: absolute; inset: 50% auto auto 50%;
transform: translate(-50%, -50%); }
@media (min-width: 768px) {
.responsive-clip { aspect-ratio: 1256 / 720; }
}
</style>
<script>
for (const clip of document.querySelectorAll('.responsive-clip')) {
const video = clip.querySelector('video');
const play = clip.querySelector('button');
clip.classList.add('is-ready');
play.hidden = false;
play.addEventListener('click', async () => {
try {
await video.play();
clip.classList.remove('is-ready');
play.hidden = true;
video.focus();
} catch {
play.textContent = 'Retry playback';
}
});
}
</script> The example gives the clip its own space in the layout. To put it behind copy, position the wrapper inside the hero, check the headline reads over the whole loop, and keep the play button above any overlay.
Why one video element, not two?
The tempting shortcut is two video elements, one hidden on mobile and one on desktop. The page looks right, but the hidden video can still download. With both cuts listed as sources of a single video, the browser picks one before it loads anything, which matters most when the desktop file is large.
Play the responsive example or read Webflow’s Code Embed instructions.
Common questions
- Can Webflow’s Background Video element show a different video on mobile?
- No. The built-in element takes one file for every screen size. For a separate phone cut, use a Code Embed with one video element that lists a source for each screen size.
- Won’t hiding a second video on mobile do the same job?
- It looks the same, but the hidden video can still download, so phones may load both files. Listing both cuts as sources of one video means each visitor downloads only the one that fits.
- Do I need a paid Webflow plan for this?
- Code Embed needs a Webflow plan that allows custom code. Check your site plan before building around it.