Player Features & Analytics

How to accelerate background videos with SmartVideo

Updated October 5, 2026

Slow background videos can hurt your page’s load speed. SmartVideo accelerates background videos embedded with plain HTML <video> tags automatically once you turn it on. Here’s how.

Accelerating plain <video> tags with videotag is available on the Growth and Pro plans. See plans and pricing.

Background-video markup

SmartVideo scans eligible <video> tags for an MP4 source; it does not detect whether a video is a background from its position or styling. Your page or theme controls the video’s playback behavior.

For a muted, looping background video, use the HTML attributes autoplay, muted, loop, and playsinline, and omit controls to hide the native player controls. Enabling acceleration does not add these attributes for you.

For WordPress users

In the SmartVideo plugin Settings, turn on Background & HTML5 videos. This enables acceleration for eligible plain <video> tags, including foreground videos, not just backgrounds.

The clip above was recorded in an older plugin version, where this toggle was labelled Optimize background videos & existing videos.

Test the page after enabling it, especially if your theme manages video playback.

For non-WordPress users (manual install)

In your existing SmartVideo head snippet, set autoreplace.videotag to true. The complete snippet below shows where it belongs. Replace YOUR_SWARM_CDN_KEY with your key from the Swarmify Dashboard.

<script data-cfasync="false">
    var swarmoptions = {
        swarmcdnkey: "YOUR_SWARM_CDN_KEY",
        iframeReplacement: "iframe",
        autoreplace: {
            youtube: true,
            videotag: true
        }
    };
</script>
<script async data-cfasync="false" src="https://assets.swarmcdn.com/swarmcdn.js"></script>

Setting videotag: false disables automatic acceleration for all plain <video> tags, including foreground videos. It is not a background-only switch. To keep acceleration on but skip one video, add class="swarm-exclude" to its <video> tag; see How do I exclude a video from SmartVideo?.


Still have questions? We’re here to help! Just click the support button on this page, and our team will assist you. 💬

Not seeing what you expect?

Ask us about features or your stats and we’ll walk through it with you.