@finsweet/attributes-autovideo

1.5.0 • Public • Published

autovideo Attribute

Auto-play videos only in viewport.

The script detects all videos on the page (Background Video components & <video> elements used in HTML Embeds) and plays/pauses them based on if they are visible in the viewport.

CDN Import

<!-- [Attributes by Finsweet] CMS Display Values -->
<script defer src="https://cdn.jsdelivr.net/npm/@finsweet/attributes-autovideo@1/autovideo.js"></script>

Package Sidebar

Install

npm i @finsweet/attributes-autovideo

Weekly Downloads

10

Version

1.5.0

License

none

Unpacked Size

7.51 kB

Total Files

6

Last publish

Collaborators

  • erikmejias
  • alexiglesias