Skip to content

Web Component with progressive enhancements for the HTML <video> element

Notifications You must be signed in to change notification settings

webfactory/video-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Web Component with progressive enhancements for the HTML <video> element

Installation

npm install @webfactoryde/video-utils

Usage

The <video-utils> Web Component is meant to be a lightweight wrapper and progressive accessibility enhancement for <video> elements that autoplay muted background video.

It implements a media query for prefers-reduced-motion: reduced and prevents autoplay if the media query matches.

Steps to implement:

  1. The JS file "video-utils.js" must be loaded. Depending on browser support requirements, transpilation for older browsers is recommended.
  2. Wrap your <video> with <video-utils>.

About

Web Component with progressive enhancements for the HTML <video> element

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published