A Javascript plugin for making videos inline background video for mobile.
Are you having trouble getting something to work? Consult the troubleshooting guide.
SOON AVALIABLE
$ npm install mobile-enabled-background-video --save
Find mobile-enabled-background-video.js
in the dist/
directory.
Make sure to include it in .
// EXAMPLE: If users device is IPHONE (Dont use this plugin for desktop)
if (navigator.userAgent.toLowerCase().indexOf('iphone') >= 0) {
var video = new MobileVideoPlayer({
videoTarget: 'video',
canvasTarget: 'canvas',
loop: true,
framesPerSecond: 60,
});
// Play video when you want!
setTimeout(function(){
video.play();
},1500);
}
You can see example usage on this link
MIT