How to Add a Self-Hosted Video That Plays on Hover in Squarespace 7.1

Interactive video makes it possible to create a richer user experience, increase engagement, and give your brand a personality. Though Squarespace allows you to embed video from sources such as YouTube and Vimeo, it does not offer a native solution for self-hosted video that auto-plays when someone hovers over it, let alone with audio and controls.

In this guide, we are going to run through creating a full-screen, full-width, sound-enabled hover-play video using our own. MP4 file, all on Squarespace 7.1.

What You'll Achieve

  • Self-hosted. MP4 video as an embedded item on your site

  • Video plays automatically on hover

  • Sound enabled (unmuted on hover)

  • Great native browser controls (play/pause, volume, full screen)

  • Responsive with Fallback Desktop & Mobile

  • No third-party branding or ads

Prerequisites

  • Squarespace 7.1 site

  • Access to a Code Block

  • A hosted. mp4 (can upload directly through the Squarespace custom file uploader).

Step-by-Step Implementation

1. Upload Your Video

  1. Navigate to Pages → Custom code → Custom CSS

  2. Use the file uploader (bottom-right corner) to upload your .mp4 video

  3. Copy the full hosted URL provided by Squarespace

Example: https://static1.squarespace.com/static/your-id/t/filename.mp4

2. Embed the Video Using a Code Block

Go to the page or section where you'd like the video and add a Code Block. Then paste the following:

Copied!
<div class="hover-video-wrapper">
  <video
    id="hoverVideo"
    src="https://static1.squarespace.com/static/YOUR-PATH-HERE/video.mp4"
    preload="auto"
    controls
    playsinline
    muted
    style="width: 100%; height: auto; display: block;">
  </video>
</div>

3. Add Javascript Code - Pages → Custom code → Code Injection → Footer

Copied!
<script>
  const hoverVid = document.getElementById("hoverVideo");
  hoverVid.volume = 0.8;
  hoverVid.addEventListener("mouseenter", () => {
    hoverVid.muted = false; 
    hoverVid.play().catch(err => console.warn("Autoplay failed:", err));
  });
  hoverVid.addEventListener("mouseleave", () => {
    hoverVid.pause();
  });
</script>

4. Add Optional Styling (in Design → Custom CSS)

Copied!
.hover-video-wrapper {
  max-width: 100%;
  overflow: hidden;
}
.hover-video-wrapper video {
  transition: transform 0.3s ease;
}
.hover-video-wrapper:hover video {
  transform: scale(1.01); /* Subtle zoom effect */
}

This styling ensures the video scales nicely across devices and adds a gentle zoom effect for visual feedback on hover.

What About Mobile?

Mobile devices don’t support hover events. Thankfully, this implementation degrades gracefully:

  • Native video controls remain visible

  • Users can tap to play with full functionality

  • No interaction? The video stays paused, saving data and performance

For custom mobile play buttons or overlays, advanced scripting can be added separately.

Why Use Self-Hosted Hover Videos?

Benefit Description
No Branding No YouTube/Vimeo overlays or ads
Sound Control Enable or mute audio based on interaction
Loop/Reset Reset on hover, leave, or let it loop continuously
Responsive Works across desktop and mobile with fallbacks
Lightweight Faster load times with optimized .mp4 files

This method is perfect for product demos, design portfolios, intro animations, or brand reels.

Final Thoughts

The native tools provided by Squarespace don't support hover-triggered video playback with sound, but with a little code, you can unlock the power of high-impact video. This scenario enables you to have full control over playback, sound, styling, and experience, while keeping your site clean, fast, and on brand.

If you want this as a plug-and-play feature or to have hover video across multiple blocks or galleries, for that matter, let us know. We offer:

  • Custom video modules for Squarespace

  • Mobile-optimized solutions

  • Video-on-scroll + background autoplay integrations


Frequently Asked Questions

Walid Hasan

I'm a Professional Web developer and Certified Squarespace Expert. I have designed 1500+ Squarespace websites in the last 10 years for my clients all over the world with 100% satisfaction. I'm able to develop websites and custom modules with a high level of complexity.

If you need a website for your business, just reach out to me. We'll schedule a call to discuss this further :)

https://www.squareko.com/
Previous
Previous

How to Hire the Right Squarespace Expert for Your Business in 2025

Next
Next

How to Prevent Image Cropping in Gallery Slideshows on Squarespace 7.1