Z O B A E R

Loading

Guide Shopify guide

Add Video to Shopify Homepage: Autoplay, MP4 or YouTube

How to add an autoplay video to your Shopify homepage in Dawn and Horizon: MP4 upload, hero video, YouTube links and a tested code snippet.
Zobaer Hossain
Zobaer H.Shopify Select Partner · 10+ years
How to add video to Shopify homepage with autoplay, step-by-step guide by Zobaer H.

A short video at the top of your store shows your product in motion before a shopper reads a word. You can add video to Shopify homepage sections without an app, in a few minutes. The tricky part is autoplay. Some themes play the video on their own, and some show a play button first.

In this guide I show you how to set up a Shopify homepage video in Dawn and Horizon, Shopify’s two free themes. You can use your own MP4 file or a YouTube logo YouTube or Vimeo logo Vimeo link. I have added homepage videos on many client stores, and these are the steps I use.

Here is what you will learn:

  • How to upload an MP4 video to Shopify
  • Horizon: a hero video that autoplays, with no code
  • Dawn: the Video section, and why it does not autoplay
  • A tested code snippet for Shopify video autoplay in Dawn
  • How to keep the video fast and working on phones

Which way should you use?

There are four ways to add video to Shopify homepage layouts in the free themes. Two of them also take a YouTube or Vimeo link, shown in the last row. Pick by theme and by whether the video should play on its own.

WayThemeAutoplayBest for
Hero with a videoHorizonYes, mutedFull-width banner
Video sectionHorizonOptional, mutedVideo with text
Video sectionDawnNo, click to playVideos with sound
Custom Liquid codeDawn or any themeYes, mutedBackground banner
YouTube or Vimeo linkBothHorizon onlyLong videos

My simple rule: if the clip is a mood shot with no talking, make it autoplay muted. If someone speaks, use a click-to-play video, so shoppers choose to hear it.

Step 1: Upload your MP4 video to Shopify

You can pick a video inside the theme editor too, but I like to upload it first. Then you can reuse it in any section, and you can copy its link for the code method.

  1. In your Shopify admin, go to Content, then Files.
  2. Click Upload files and choose your MP4.
  3. Wait until the upload finishes.
  4. For the code method later, click the Copy link icon next to the video. Paste the link somewhere safe.
Add video to Shopify homepage: uploading an MP4 in Content, Files, with the Copy link icon and video file limits
Step 1: upload the MP4 in Content, then Files. The Copy link icon gives you its URL.

Shopify accepts MP4, MOV and WEBM videos up to 1 GB, up to 10 minutes long and up to 4K. You can check the full list in Shopify’s file upload requirements. Those are upper limits, not targets. A Shopify homepage video should be far smaller.

Shopify recommends these aspect ratios for video: 16:9, 9:16, 4:3, 3:4 or 1:1. For a banner, I use 16:9 for desktop and a vertical 9:16 clip for phones.

How to add video to Shopify homepage in Horizon (autoplay, no code)

Shopify video autoplay is built into Horizon, so you don’t need any code. You have two choices: a video in the Hero banner, or a Video section.

Option A: a full-width hero video

  1. Go to Online Store, then Themes, and click Customize. The home page opens first.
  2. Click your Hero section. No hero yet? Click Add section and choose Hero.
  3. Under Media 1, set Type to Video.
  4. Under Video, open the file picker and choose your MP4, or upload a new one.
  5. Leave Media 2 empty for one full video. Fill it only if you want two media side by side.
  6. Under Layout, set Width to Full and Height to Large or Full screen.
  7. Under Appearance, turn on Media overlay so your heading stays easy to read.
  8. Click Save.

I checked the theme code: Horizon’s Hero always plays its video muted, on a loop, with no player buttons. That is exactly what a background Shopify homepage video needs, and it is the quickest way to add video to Shopify homepage banners.

Shopify homepage video in Horizon: Hero section with Media 1 type set to Video, plus the Video block Autoplay setting
Step 2 in Horizon: set Media 1 to Video in the Hero. The Video section has its own Autoplay box.

For phones, tick Show different media on mobile. Then pick a vertical, lighter clip under Mobile media 1. A wide video on a tall phone screen gets cropped a lot, so a vertical version looks better.

Option B: the Video section with Autoplay

  1. Click Add section and choose Video.
  2. Click the Video block inside the new section.
  3. Set Source to Uploaded and pick your file. Or choose External URL and paste a YouTube or Vimeo link.
  4. Tick Autoplay. The editor adds a note: “Videos will be muted by default.”
  5. Keep Loop video on (it is on by default), then click Save.

Leave Autoplay off if you want a play button instead. That suits a product demo where the sound matters. With the box unticked, this section has no Shopify video autoplay.

Dawn: add a Shopify homepage video with the Video section

Dawn has one built-in section for video, called Video. The Image banner and Slideshow sections take images only. I checked their code, and they have no video setting.

  1. In the theme editor, click Add section and choose Video.
  2. Under Shopify-hosted video, open the video picker and choose your MP4.
  3. Or, under Or embed video from URL, paste a YouTube or Vimeo link into URL. This link is used only when no Shopify-hosted video is selected.
  4. For a link, add a Cover image. Fill in Video alt text so screen readers can describe the video.
  5. Tick Loop video and Full width if you want them, then click Save.
Add video to Shopify homepage in Dawn: Video section settings next to a Custom Liquid section with autoplay video code
Step 3 in Dawn: the Video section plays on click. A Custom Liquid section gives you autoplay.

Here is the catch. Dawn’s Video section does not autoplay, and it has no setting for it. It shows a cover image with a play button. The video loads and plays, with sound and controls, only after a shopper clicks. That is good for speed and for videos with talking. It is not what you want for a moving banner.

If you are thinking of moving to Horizon for its built-in autoplay, my guide on how to change your Shopify theme safely walks you through it.

Shopify video autoplay in Dawn: a tested Custom Liquid section

For a looping background video in Dawn, add a Custom Liquid section. This is the cleanest way to get Shopify video autoplay in Dawn without an app. You don’t edit any theme files, and you can delete the section any time.

  1. Copy your video link from Content, then Files (the Copy link icon). For a still image that shows while the video loads, upload one frame as a JPG and copy its link too.
  2. In the theme editor, click Add section and choose Custom Liquid.
  3. Paste the code below into the Liquid code box.
  4. Replace PASTE-YOUR-MP4-LINK-HERE with your video link, and PASTE-YOUR-POSTER-IMAGE-LINK-HERE with your image link. No image? Delete the whole poster line.
  5. Under Padding, set Top and Bottom to 0.
  6. Drag the section to the top of the page, under the header, and click Save.
<div class="zh-video-hero">
  <video class="zh-video-hero__video" autoplay muted loop playsinline preload="metadata"
    poster="PASTE-YOUR-POSTER-IMAGE-LINK-HERE" aria-hidden="true">
    <source src="PASTE-YOUR-MP4-LINK-HERE" type="video/mp4">
  </video>
  <div class="zh-video-hero__content">
    <h2 class="zh-video-hero__title">New summer collection</h2>
    <a class="zh-video-hero__button" href="/collections/all">Shop now</a>
  </div>
</div>

<style>
  .zh-video-hero { position: relative; overflow: hidden; height: 80vh; min-height: 420px; max-height: 760px; background: #111; }
  .zh-video-hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .zh-video-hero__content { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px; text-align: center; background: rgba(0, 0, 0, 0.3); }
  .zh-video-hero__title { margin: 0; color: #fff; font-size: clamp(28px, 6vw, 56px); line-height: 1.1; }
  .zh-video-hero__button { display: inline-block; padding: 14px 32px; background: #fff; color: #111; text-decoration: none; font-weight: 600; border-radius: 4px; }
  @media (max-width: 749px) { .zh-video-hero { height: 70vh; min-height: 360px; } }
</style>

<script>
  if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
    document.querySelectorAll('.zh-video-hero__video').forEach(function (v) { v.removeAttribute('autoplay'); v.pause(); });
  }
</script>

Change the heading, the button text and the /collections/all link to your own. If you only want the moving picture, delete the whole zh-video-hero__content block.

What each part does, in plain words:

  • autoplay muted: starts the video on its own. Without muted, browsers block it.
  • loop: starts the clip again when it ends.
  • playsinline: plays the video inside the page on phones, not in full screen.
  • poster: shows your still image while the video loads, or if a phone blocks autoplay.
  • object-fit: cover: fills the banner on any screen size, cropping the edges if needed.
  • The small script: stops the video for shoppers who set their device to reduce motion.

I tested this code in a real browser at a desktop size and a phone size. The video started on its own, filled the banner and caused no sideways scrolling. Then I removed muted, and the same video stayed paused. The code also works in a Horizon Custom Liquid section with Width set to Full, but Horizon’s Hero is simpler.

Using a YouTube or Vimeo video instead

A link is handy for long videos, because YouTube or Vimeo hosts and streams the file for you. The trade-off is less control over the look, since the player comes from them. Here is how each theme handles a link:

  • Dawn: the Video section shows your cover image and plays the video only after a click.
  • Horizon Video section: with Autoplay ticked, Horizon adds autoplay and mute to the link, so it starts muted on its own.
  • Horizon Hero: takes uploaded videos only. It has no link setting.

When I add video to Shopify homepage banners, I always use an uploaded MP4. For a long brand story or a how-to, a YouTube link with a play button is fine.

Why Shopify video autoplay needs the video muted

This is a browser rule, not a Shopify rule. Browsers let a video start on its own only when it is muted or has no sound track. A video with sound waits until the shopper taps or clicks. No theme setting or app can get around it, so a Shopify homepage video that autoplays will always start silent.

Phones add two more rules. Without playsinline, some phones open the video in full screen instead of playing it in the page. And some phones in battery saver mode skip autoplay and show the still image. That is why a poster image matters.

Shopify video autoplay on a phone: a muted homepage video playing inline, with browser autoplay rules
Muted video plays on its own. Video with sound waits for a tap.

Tips for a fast Shopify homepage video on mobile

A video is often the heaviest thing a homepage loads. These habits keep your Shopify homepage video light:

  • Keep it short. A loop of a few seconds is enough for a banner.
  • Remove the sound track. A muted video doesn’t need one, and the file gets smaller.
  • Don’t upload 4K for a banner. Shopify’s video player streams in 480p, 720p or 1080p, based on the shopper’s connection. A 1080p export is plenty.
  • Compress the file before upload. This matters most for the code method. Shopify’s own sections can pick a lighter version for slow connections, but the code loads your MP4 file itself.
  • Use a vertical clip for phones. In Horizon, that is the Show different media on mobile setting.
  • Use one autoplay video per page. Several videos playing at once slow the page and distract shoppers.
  • Test the speed. Check your homepage speed before and after you add the video, on a phone.

Images matter as much as video for a fast homepage. My Shopify image sizes cheat sheet lists the right size for every banner and section.

Common problems and fixes

My video shows a play button instead of autoplaying

In Dawn, the Video section works that way by design. Use the Custom Liquid code above. In Horizon, open the Video block and tick Autoplay, or move the video into the Hero.

Shopify video autoplay works on my computer but not my phone

Check that your code has both muted and playsinline. Then turn off battery saver on your phone and test again. If the poster shows but nothing moves, the phone is blocking autoplay, and the still image is doing its job.

The video is cropped or has black bars

A banner rarely has the same shape as your video. Cover mode fills the space and crops the edges, so keep your product in the middle of the frame. A separate vertical clip for phones fixes most cropping.

The video is slow to start

The file is too big for a Shopify homepage video. Shorten the clip, drop the sound track and export at 1080p, then upload it again. A poster image hides the wait.

The upload fails or never finishes

Check the file is MP4, MOV or WEBM, under 1 GB and under 10 minutes. If it still fails, export it again from your video editor and retry.

Frequently asked questions

How do I add a video to my Shopify homepage with autoplay?

To add video to Shopify homepage banners with autoplay in Horizon, set the Hero’s Media 1 type to Video, or tick Autoplay in a Video section’s Video block. In Dawn, add a Custom Liquid section with a muted, looping video tag, like the code in this guide.

How do I add a video to the Shopify homepage without YouTube?

Upload your MP4 in Content, then Files. Then pick it for your Shopify homepage video in the Hero or Video section, or paste its link into the Custom Liquid code. Shopify hosts the file for you.

Why does my Shopify autoplay video have a play button?

Either the section is click-to-play, like Dawn’s Video section, or the browser blocked autoplay because the video is not muted. For Shopify video autoplay, use a muted video in a section that supports it.

What size should a Shopify homepage video be?

Use 16:9 for desktop banners and 9:16 for a phone version. Export at 1080p, keep it short, and stay far below Shopify’s 1 GB and 10 minute limits.

Why is my Shopify video not playing on mobile?

Most often the video is not muted, the code is missing playsinline, or the phone is in battery saver mode. Fix the code first, then test with battery saver off.

Can a Shopify homepage video autoplay with sound?

No. Browsers block autoplay with sound until the shopper interacts with the page. Autoplay muted, and use a click-to-play video when the sound matters.

A short, muted Shopify homepage video at the top of your store is one of the easiest ways to make a homepage feel alive, and it takes minutes in either theme. For more practical guides like this, see my Shopify tips, or compare the two free themes in Dawn vs Horizon. If you want a homepage that looks and sells better, I build them as part of my Shopify store redesign service. Message me on WhatsApp and I will take a look.

Zobaer Hossain, Shopify designer

Written by Zobaer H.

Shopify Select Partner with 10+ years of experience and 5,000+ clients. I design and build Shopify stores, and I write these guides from real client work.

Shopify Select Partner badge

In this guide

    ★★★★★ 4.9 from 1,350+ client reviews

    Let's start

    Ready to start your store?

    Send me your idea or store link. I'll reply with honest advice and a fixed quote.

    ✓ Free quote✓ Fixed price✓ You own everything