Do not load a video on mobile

Hi team,

I’ve added a video as the background for my hero.

On mobile (for slower connections), I’ve used an image.

In principle, it works, but the video is still loaded into the DOM and it’s slowing down my Lighthouse results (and ultimately, it doesn’t load any faster on mobile because it’s still loading).

Do you know how to remove this video on mobile?

Thanks

1 Like

Just be mindful wp_is_mobile() won’t work if there’s page caching.

1 Like