1.0.1 • Published 6 years ago
autoplay-video v1.0.1
WIND OPEN
Autoplays an inline <video>
with audio if possible, muted otherwise.
Install
npm i autoplay-video --save
yarn add autoplay-video
Usage/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