WP Manifestindependent plugin directory
manifest / performance / lazy-load-videos

Lazy Load Videos

Plays videos when scrolled in to viewport.

★ 0stars

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/tugbucket/lazy-load-videos/archive/refs/heads/main.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Plays and pauses videos when entering and leaving the viewport. Can also load videos when entering the viewport.

Shortcode options

[lazyloadvideos pauseonscroll="yes"]

The parameters are yes and no

By default it’s set to yes. The videos should start playing when you scroll into view and pause when scrolling out of view. If set to no, the videos start playing when scrolled into view and do not pause after scrolling out of view.

Notes

To lazy load the videos, meaning only loading them when scrolled into view, you have to alter your HTML video tag.

For example: <video src="<path to your video>"></video>

Change that to: <video data-src="<path to your video>"></video>

Note that the new HTML does not contain an src attribute and it now says data-src.