autoplay-video
v1.0.1
Published
Autoplays an inline <video> w/ audio if possible, muted otherwise
Readme
WIND OPEN
Autoplays an inline <video> with audio if possible, muted otherwise.
Install
npm i autoplay-video --save
yarn add autoplay-videoUsage/Options
- preventPause: boolean
- muted: boolean
const videoElement = document.querySelector('video');
autoplayVideo(videoElement);
// or muted without pausing
autoplayVideo(videoElement, {
preventPause: true,
muted: true,
});Thanks
This script relies entirely upon can-autoplay
License
MIT License © Lane Goldberg
