1.0.1 • Published 5 years ago

autoplay-video v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

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