angular-video-background
light module for using any video as background with many options
The idea came when I needed to use a video as background for one website and looking around on the web I saw: Vide and it works very good, but uses jQuery and I didn't like the code too much so I decided to write my own.
Getting started:
Download the package using npm package manager:
npm install angular-video-background
or clone it from github.
Add the script to your html page.
<script type="text/javascript" src="video-background.module.js"></script>
and than add the module to your application dependencies:
angular.module('app', ['video-background'])
and you can start to use the directive video-background it in your application.
Basic usage:
The directive most important attribute that must be specified in order to work correctly. The attribute is source, that specify the object with the source/s of the video in the format type: "source".
myVideo = {
mp4: public/myvideo.mp4,
ogg: public/myvideo.ogg
}
Note: you should pass a object to the attribute.
<video-background source="myVideo"></video-background>
Directive attributes:
- source: the object containing the video source/s
- autoplay: set the video auto play attribute (default true)
- on-firstplay: a callback to run when the video play for the first time
- on-firstend: a callback to run when the video ends for the first time
Coming soon many customization examples..