Webflow sync, pageviews & more.
NEW

How can I make a video hosted on Dropbox autoplay when it is scrolled into view on my Webflow site? The video currently only plays in the preview but does not autoplay on the published site.

TL;DR
  • Convert Dropbox link to a direct MP4 URL and embed it in Webflow using a <video> tag with autoplay, muted, and playsinline attributes.
  • Add JavaScript with IntersectionObserver to trigger .play() when the video is scrolled into view; for reliability, prefer using dedicated video hosting services.

To autoplay a video hosted on Dropbox when it's scrolled into view on your Webflow site, you need to address two key limitations: Dropbox doesn’t provide reliable direct media embedding, and Webflow requires a specific setup for autoplay and interaction triggers.

1. Host the Video Properly

  • Dropbox is not optimal for hosting autoplay videos. It provides shared links meant for downloading, not for reliable media streaming on websites.
  • Instead, use a service like Vimeo, YouTube (with ?autoplay and mute), or direct video hosting (via Webflow's native Video component or an external CDN with MP4 support).
  • If you must use Dropbox, get a direct file link (convert www.dropbox.com/s/... to dl.dropboxusercontent.com/s/...), but autoplay may still be blocked or inconsistent.

2. Add a Custom Video Element in Webflow

  • Use a HTML Embed block in Webflow and embed a <video> element with autoplay and muted attributes.
  • Example:
    <video src="https://dl.dropboxusercontent.com/s/yourfile.mp4" autoplay muted playsinline></video>
  • Note: Some browsers block autoplay unless the video is muted and inline.

3. Use Webflow’s Interactions to Trigger Play on Scroll

  • Webflow doesn’t natively control <video> elements with interactions, so you’ll need custom JavaScript.
  • Add a custom embed component in the Footer or Page Settings that watches for when the video enters the viewport and then triggers .play().

4. Add JavaScript to Play on Scroll

  • Below is an inline-friendly script for your video with ID #myVideo:

  • Add an ID to your video tag:
    <video id="myVideo" src="..." muted playsinline></video>

  • Then add the following custom code in your Page Settings > Before tag:
    `

    `

  • This ensures the video only plays when 50% or more is visible.

5. Test Cross-Browser Behavior

  • Make sure your video is encoded in MP4 format for broad compatibility.
  • Test with autoplay, muted, and playsinline attributes to meet browser autoplay policies.

Summary

To autoplay a Dropbox-hosted video on scroll in Webflow, convert the Dropbox link to a direct MP4 URL, embed it with a <video> tag using autoplay and mute, and add JavaScript using an IntersectionObserver to trigger .play() when the video scrolls into view. Dropbox may still cause reliability issues, so using a proper video hosting solution is recommended.

Rate this answer

Other Webflow Questions